Add recursion check to createService()
This will throw when trying to create a service while already in the
process of creating that same service, i.e., if there's a circular
service dependency. This would have saved me a whole bunch of debugging
Imported from MediaWiki core a995d9be1dfc5741713.