Threadify file logger, handle save files form cmdline

fixes #638
Sure, it's probably good, but if we're going to bother locking anyway, why not guard the entire function just to be safe :) ?