Fix commands with `tty` option set running in the wrong directory

No path change was made for a command running in the foreground (using the
tty option). These commands were running in the same directory as beam.json
and not the beam working directory as they need to be.