Reset lock script: also for sem.value > 1

If the semaphore value is > 1, then we reset it to 1.

Also change most of the "unlock" to "reset".