Stop input loop on exit