Add Locking.swift

Just contains a withLock<L: NSLocking, U>(L, () -> U) -> U function
(and an overload for Void return types).