Make test_file run faster

We only need the sleep in the modify test, not in the create test.  Move
this there.
Wrap os.stat in a method in DirectoryWatcher

So we can make this more easily mockable.
Faster QueueTask shutdown, better CPU usage

Currently, QueueTask polls the queue every 600ms, and checks for
shutdown events in-between.  This causes each queuetask-based test case
to take 600ms.

Instead of relying on the poll timeout, insert a sentinel object into
the queue on shutdown.  Check for the sentinel object, reinsert it, and
break if it's detected, so multi-worker queues can also shut down
gracefully.

As a result, I've decreased the polling interval from 600ms to 1.0s.  We
can probably increase this further, but will hold off for now unless
someone really needs this later on.

I've observed test case duration dropped from 600ms per test case to
12ms per test case.
Make PeriodicTask test much faster

before each test was taking ~500ms.  Now, both combined take 120ms.

Do this by explicitly tracking threads and polling the counter after
sleeping intervals of 100ms (and allowing for up to 3.0s to run) instead
of sleeping 500ms and *hoping* enough iterations had happened.
Make file test case pass more quickly

Explicitly pass a probably different mtime/atime for the utime call in
order to try to force an update sooner.

There's a small chance this could break things if the tmpfs doesn't
properly support utime, but that's highly unlikely.