tests: fix the flaky test test-logtoprocess.t
The main change is that we're waiting for the [touched] file to appear for 5 seconds instead of 0.1 seconds. Also, instead of implementing wait-on-file from scratch, we use the existing one from testlib/ that works well.
$ LANG=nonexistent LC_ALL=nonexistent LANGUAGE=nonexistent hg version -q
Mercurial Distributed SCM (version *) (glob)