Close stdout and stderr if they've not been redirected to files (when demonising)