Use a separate thread for logging to stderr.