and CORE-1079: Every attach of fbclient/fbembed library leaks 64KB of memory
To do it:
- created new template GlobalPtr, controlling access to destructors of global objects.
- applied it to global objects.
Also some related cleanup.
ThreadData.cpp - thread control class to use in Client
thd.cpp - thread control class to use in Server
To avoid making global visibility of a lot of THD_* ISC_event and so functions in libfbclient.so
(Can be breakable but needed)
PandoraBox* pbox = reinterpret_cast<PandoraBox*>(&can_of_worms);
pbox->open();
pbox->flush();
Nickolay may want to undo my ods.h changes if gcc insists
in its crusade against non-PODs and poodles.