Back to locking-based solution
  - remove BuildScheduler, it introduces race condtions
  - Improve lockmanager: one per model type.