Flush streams before exiting.