PHOENIX-93 Add shutdown hook to free any straggling resources (JamesTaylor)