Make sure stdout is flushed before process.exit

Fix for https://github.com/facebook/jest/issues/110