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.