Add file locking to file logger

Flocks the handle and also seeks to the end for good measure
before writing.
changelog
Merge branch 'pr/936' into devel

Fixes #936