This sounds like an OS or kill bug not a with the program. Sending `kill -9`, aka `kill -KILL` is supposed to terminate the process immediately without giving it the opportunity to catch the signal and respond. (This is why you should start with `kill -TERM` and only resort to `kill -KILL` if that does not work.)
So if the process is not terminated this is an OS or kill issue because the process itself is not given a chance to catch the signal.