Unix rtlib: Make calls to fb_hExitConsole()/fb_hInitConsole() thread-safe

These functions aren't thread-safe themselves (accessing globals etc.),
so locks must be used when they're called from places that could be run
from multiple threads at a time.

There are additional calls from fb_hInit()/fb_hExit() but I don't think
locks are needed there as those are run from fbrt0.o's global ctor/dtor,
which should only be run by the main thread.