(#21201) Remove thread-safety code

Puppet does not support running in any threaded environments. The thread
safety code that has been added has been, for the most part, haphazard and
not a holistic solution to the threading problem. There are many areas
that are not protected at all and others that were protected in incomplete
ways. The extra code and logic only caused more complication in the
codebase and is removed by this commit.