Propagate error message correctly in wcs pipeline

As reported by Chris Frohmaier on astropy@scipy.org