Fix thinko.
Replace the old thread exemption mechanism with something more reliable.