make sure we get the right service **before** closing the connection.

Fixes an urgent issue where `mon create` fails in Debian because it checks the `service` executable after the connection is closed.