Clean up handle before killing file