MODE-2259 Fixed the WF/EAP subsystem so that services are correctly deployed in domain mode.

This PR is only suitable for `master`. If the fix is correct, another PR will be required for the `3.x` codebase(s).