Refix service access protection

Reverted my previous fix and applied fix from upstream; the upstream fix is better in that if corrects the problem where it originally occurred, in src/connection.c