Added a monitor lock class

Based on the Scoped Locking pattern in POSA volume 2.