Verify that wrapped is not None

If wrapped is None we raise a ValueError to let the user know that we
are unable to continue.
backport #1320 and https://github.com/Pylons/pyramid/commit/09beb29cb2a142c798d97caf17ead9def79f0843 from master to 1.5