Disconnect tmp database before deleting file