Add regression test for #5237

This PR adds a test for a bug in `ServiceManager::canCreateServiceWithName()` that #4285 was supposed to fix but was actually fixed by #5237.

@weierophinney
any chance to include both this and #5237 in 2.2.5? The bug is quite a nasty one.