Fix race condition and enable socket

Fixes race condition between service and socket and also enables the socket automatically when the service is enabled.