Refactor KillMask
Related to #2833 but only refactoring the existing logic to make it understandable + avoid global dict with references to greenlet objects.
The only behavioural difference is the warning you get when entering a KillMask
context in a native greenlet that is not the main greenlet. Raising an exception seemed a bit harsh so I just log the warning for now.