use local scope for zsh emulating sh

Addressing #686

@wjwwood Can you please verify that this works well on Mac OS. E.g. with a small workspace like `ros_core` and making sure that the environment hooks are sourced correctly.