Add an ifdef around flock() for MinGW. This shouldn't result in reading
of an incomplete last line and even if it does, other code should safely
handle it anyway.