Handle sigterm properly. Refs #87