Make setCWD() with bad paths safer
Summary: Ref T10853. This isn't a complete fix, but should prevent the most serious mistakes with setCWD() on bad paths.
Test Plan:
- Wrote a script using setCWD().
- Gave it a bad path: got an explicit error.
- Gave it a good path: things worked great.
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T10853
Differential Revision: https://secure.phabricator.com/D15785