_get_deployment_lock: Close the lock file when unlocking