refactored mutex logic around writing log line segments. corrected
initialization of log handler array.