Update lock to use lua-based script which simplifies execution and
removes possible timing issues per Issue #18.
Fixs Issue #18.