Flush stdout, stderr before forking. From Richard Purdie. Thanks!