set O_CLOEXEC so that the log file gets closed on exec