Fix "flock(): <ID> is not a valid stream resource"

Update \File::close_file() and fixing an error thrown coming from closing a file-resource before unlocking it
Merge pull request #1492 from philipptempel/1.7/develop

Fix \File::close_file() -> "flock(): <ID> is not a valid stream resource"