Add a shutdown function so spin() can be aborted by a program linked against libopenleap