replace the use of O_EXLOCK with flock, so it compiles on linux again