I noticed this some time ago, but note that the issue still happens (checked with Mint 14 and clang version 3.0-6ubuntu3).
Basically there's a miscompile of the io library which leads to Lua unable to actually close a file handle. It's related to the change in how file objects are internally structured.
I haven't seen any sign of this being a problem. with the clang that comes with OS X, so perhaps a Linux issue?
Not a train smash, but if clang is going to be serious on Linux it has to not mess up basic stuff like this ;)
steve d.