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.