Changed browser manager threading and fixed irc

BrowserManager was using ::CreateThread instead of _beginthreadex.
Changing allows us to be able to wait on the thread handle.
Fixed a bug where apparently irc_destroy_session has a race when
connecting or running.  Now waits for the thread to exit completley before
destroying the session.