Added specs on standard IO with sync set to false upon process exit.
Always flush standard IO when exiting.
Merge pull request #3032 from razielgn/fix-unflushed-stdio

Always flush standard IO when exiting.