Use ReentrantMutex REPR and new ops for Lock.

Means it is no longer tied to the JVM.
Move Lock.pm out of src/vm, now it's VM-generic.