100bbfa Revert check_init changes and refactor.

Authored and Committed by Carlos O'Donell 4 years ago
    Revert check_init changes and refactor.
    
    The check_init changes are not MT-safe and even though they should
    only occur during early startup it's possible that we end up calling
    malloc in multiple threads as the first call and that isn't going to
    work. Therefore we revert check_init changes and go back to explicit
    initialization in a constructor. We make it a prioritized constructor
    so it runs as early as possible.
    
        
file added
+36
file modified
+93 -107
file added
+52