Improve cleanup of resources opened by the analyze() methods.

Before issue #8, there would be exactly one FileInputStream per file
that was being analyzed, and it was pretty easy to ensure that this
stream was closed. Issue #8 changed this, but it didn't add logic to
ensure that the extra streams were closed if there was an error before
the document was added to the index.

This change attempts to improve the situation by making sure that
readers or token streams associated with the fields in the Lucene
document are closed if something goes wrong.
Improve log formatters

Fixes the following issues:

- SimpleDateFormat is not thread safe, so the shared instance should
  be protected by synchronization.

- Logged exceptions are hidden on low log levels, even if the handler
  is configured to show messages on that level.

- IndexDatabase re-implements printStackTrace() in order to work around
  exceptions not being logged on low log levels.