Fix silly copy-paste lock/unlock bug.

Didn't show up on Windows due to mutexes working differently.