Add file locking to file logger

Flocks the handle and also seeks to the end for good measure
before writing.