Workaround bogus msgcat conflicts.

Sometimes, msgcat produces conflicts in automatic comments (see the gory
details at
https://groups.google.com/d/topic/poedit/j41KuvXtVUU/discussion).  As a
workaround, just filter them out.
Fix non-OSX compilation.
Fix reporting of Lucene errors.

LuceneException::what() isn't implemented, so all errors were reported
as "unknown exception".  Report the actual error, with error code,
instead.
Create TM directory if it doesn't exist yet.