Fixes various resource leak issues.

MailDaemon leaks, BatchFlusher leaks, TrackerLogger leaks, UPOSW not
being closed, initKeywordSearch not releasing the inputstream when
loading the search directory.

Currently leaves an undeployed webapp with 0 connections and 0 orphaned
threads.
Merge branch 'emma' of github.com:intermine/intermine into emma

Conflicts:
	intermine/api/main/src/org/intermine/api/tracker/TrackerLogger.java