Maintain a lock on the input file

Closes #77