Make sure stdout is flushed before process.exit

Fixes https://github.com/facebook/jest/issues/110