Introduce `error-shutdown!` function for handling fatal errors

This commit does the following:

* Introduces a `context` atom in services.clj, whose value is a
  map used to keep references to the various stateful bits of
  the PuppetDB subsystems.  This is something that has been
  discussed previously as a means for potentially allowing more
  interactive development in the REPL, and for doing things
  like dynamically reloading subsystems when configuration
  changes occur.  In this commit, it's used to provide a way
  to shutdown those subsystems when a fatal error occurs.

* Adds the new `error-shutdown!` function, which is responsible
  for shutting down threads and subsystems from the `context`
  when a fatal error has occurred.