quit to and internal main outside the trap - avoid deadlock for ruby 2.0.0