Fix a segfault in `astropy.wcs._wcs`.

At a certain point in our test suite under certain conditions, the interpreter stops being able to allocate even fairly small objects.  I haven't gotten to the bottom of why that is, but this fix at least prevents that case from becoming an out-and-out segfault.