clean standalone client/server shutdown code

cleaned up shutdown handling for clean thread shutdown (not the ugly
force-termination I had before).  also finally found a solution to make
irrlicht's logging messages use the locking macros