Fixed variables names, fixed idle script

* Several variables were copy-pasted incorrectly, resulting in, e.g.,
  the START_LOCKFILE being used as the default IDLE_LOCKFILE. This
  caused problems.
* The idle script wasn't preventing the race condition with sed
  correctly. Previously, it tried to wait until the file was not open by
  anyone, which is silly, since sed will keep it open. It was also just
  buggy. Now it continues reading until it gets a non-blank result.