fix insideous problem with mutex initialisation

explanation: we use pthread_once to define a mutex type descriptor,
used to define some of our mutexes as recursive mutexes. Now,
pthread_once relies on a counter stored in a given location;
we used a non-exported global var for this counter.

Unfortunately this ties the mutex initialisation to the static
initialisation of the compilation unit holding this counter variable.
Theoretically it would be possible (we never observed such an incident)
that, during static initialisation, a singleton was brought up,
which requires a class-scoped lock, implemented as recursive mutex.
And it would be possible for this singleton locking to happen prior
to initialisation of the mentioned counter variable.

As a fix, I've moved the counter varialbe into a function scoped
static variable, since that is guaranteed by the C++ runtime system
to be initialised at first usage of the function, irrespective of the
initialisation order of the enclosing compilation units
test.sh: double VSize limits to prevent frequent test suite failure

especially the DiagnosticContext_test seemst to hit the
previously set limits regularily, which is somewhat strange
WIP: draft an improved version of the Singleton factory

...this would both improve our general design and circumvent
the problems with Clang and static variables
WIP: draft internal structure of dependency factory
WIP: improve the API
WIP: stubbed factory functions
reshape the management interface

now using static functions; which simplifies building
a scoped object to install a mock automatically within
unit tests.
draft the creation and lifecycle facilities
implemented the standard code path of DependencyFactory

still mising: a mechanism to inject mock objects temporarily
brainstorming: how to implement the test mock injection
reworkted Singleton / DependencyFactory unit test pass
move header for test support
Ticket #934: switch entire code-base to use the new Singleton factory

lib::Depend<TY>  works as drop-in replacement for lib::Singleton<TY>

This changeset removes the convoluted special cases like
SingletonSub and MockInjector.
resolve problem with static initialisation order

...uncovered by the better checks of the new DependencyFactory!
move test mock support into separate header. Write comments (closes #934)