Shutdown Serf before stopping engine

If engine is stopped before Serf, some requests are sent to stopped
engines.