spawn shell before clossing TTYs object descriptors

This bug prevented shells to attach to a valid TTY, now it works correctly so getty can be started from [forever](https://github.com/nodejitsu/forever). Also I've changed the hardcoded $CWD to be the actual working directory.