Add shared_singleton utility

shared_singleton allows statically allocated objects to use a singleton and be
assured that the singleton will outlive them.
Fix up small_object_allocator