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

Update \File::close_file() and fixing an error thrown coming from unlocking a file-resource after closing the resource-handler.