Add missing semicolon
Don't block on every !pet

Use the SIGINT/SIGTERM instead to save once when exiting.