Fix problem in filelogger which resulted in broken log entries

write() is not guaranteed to write all data at once and under high load we got log messages with broken format, after this patch the problem seems to have been fixed.