backported fix for improved publication factory lookup

Backported the improvement that was handled in https://github.com/zopefoundation/zope.app.publication/pull/1

Original description:

"""
Improve the publication factory lookup by falling back to a more generic registration if the specific factory chooses not to handle the request after all. Also, fail clearly by raising an configuration error //always// if no handling factory can be (instead of returning None in that case, which is not handled properly in the callee).
"""

If the pull request is accepted, I can release a 3.15.0.
How is this function related to the PR?  Is this from a stray commit?

It would seem better to introduce the hook in a commit which motivated it somehow (i.e., by defining a subclass of `ZopePublication` which overrides it, or at least by documenting how it would be used).