properly ref/unref the handle and run the loop again for shutdown purposes