create log file safely, don't create world-writable files