Fix check-for-update.sh race condition regarding lock file