Merge pull request #387 from exarkun/crypto-locks

expose num_locks and {get,set}_{id,locking}_callback