stop postgres gracefully to prevent corruption