Handle "cabal test" exit code correctly

Rather than letting the default exception go through when the process
exits with non-zero status, spawn and wait for the process then exit
with the appropriate status code.