Adds stop handler to pykmin.