[connman] fix service structure access while unreferencing

It's unsafe to access service struct after possibly unreferencing it
for the last time, so needed to change the order of statements in
stop_recurring_online_check() so that access after last unref isn't
possible.
[connman] network: protect service structure access with reference

As __connman_connection_gateway_remove() may unref service, wrap
network.c:set_disconnected() with connman_service_ref/unref to make
sure the struct stays around during the function call.