[server][HatoholThreadBase] Add a mechanism to execute mainThread() when an exception is caught.