Don't free the lock before it's time, nor delete the WAITFILE

Merged Alex Iribarren requested to merge wait into master

Merge request reports