Various c++ idiomatic changes on logger
Fixes cross process locking
Adds RAII resource for locking files