Fixes NB#106361, stack overflow caused by recursive calls to a signal handler