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
Merge pull request #1441 from stevepiercy/1.5-branch

backport #1320 and Pylons@09beb29 from master to 1.5