ensure worker/pool state is safely restored in event of unexpected exception killing worker