Restore workspace locking functionality.

It got lost during the merge.