Flush and sync lock file when acquiring session lock