Add a safe version of getFStat

The function getFStat causes an IOError if the file to be stated does
not exist. In some cases, however, the only thing we care about is whether
it has changed, with disappearing being a legitimate change. So add a wrapper
that catches the IOError and returns nullFStat.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add a generic function capable of watching a file

Add a method to return the new value of a function if it changes within
the given timeout. If not, return the old value. Make use of the fact,
that the function only changes, if the specified file changes on disk.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Make luxid support WaitForJobChange

Make support the WaitForJobChange, waiting for a job to
change on certain monitored fields.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>