close race if an exit signal hits the worker before trap