Always log stdout/stderr somewhere.

If launched with /dev/null as our terminal, redirect stdout and stderr to our
logfile. Otherwise, useful information (e.g. backtraces on a crash) can be lost
forever.