Closing file if flock fails

Should close descriptor if flock() fails