Fix Minitest exit hook hack to handle Minitest 5