Set trap after initial fork to prevent killing caller