Check for parent process only every few seconds.

Fixes #3252. Also probably fixes #2890, which we might have misattribued
to file watching in the tool process.