Locks are now of type OrderedLock

There is a very funny bug: the newly inserted constructor param is only
visible when the generated class is used by the java compiler, but not
when using the scala compiler. It still works fine using the scala
compiler if the newly added param is dropped when calling the
constructor!