driver: Fix -working-dir for foreign files
-working-dir definitely needs more serious testing, there are some easy ways to test this.
- Modify Cabal to call ghc using -working-dir rather than changing directory.
- Modify the testsuite to run ghc using
-working-dir
rather than running GHC with cwd = temporary directory.
However this will have to wait until after 9.12.
Fixes #25150 (closed)