Rework how we use threads in the main http loop.

This is an attempt to fix
https://github.com/snapframework/snap-server/issues/61 (forkOS_entry:
interrupted on exit). Simon M reports that this happens if you try to
forkOS (or runInBoundThread) when the main thread has started its exit.
He suggested to make sure that all child threads (especially ones
calling into HsOpenSSL code) are dead before the main thread exits.

To that end:

  - introduce a new abstraction `SnapThread` that you can `wait` on

  - use the much higher-precision system monotonic clock (via the
    "clock" package) in TimeoutManager rather than epochTime

  - rewrite timeout manager. Frequency of thread reaping is now
    controllable, and timeout manager keeps track of threads until they
    finish.

  - various exception/bracket/masking fixes (I'm sure there are more
    issues remaining).