Remove make_lockfile() global function and create a Lock class using create() method for locks