Your explanation, which of course makes perfect sense, made me think more about the use of flock; You stated, "I wouldn't do it here, but that's just me." I have no doubt you have a reason for this, and I'd actually like some insight on your suggested uses of flock.
In addition, I imagine that the flocked file is automatically un-flocked when it is closed, but is there any benefit(s) to explicitly calling flock(TEST, 8) before closing the file?