BUG: core: fix crash when unpickling data on Py3 under non-latin1 encoding

As noted in the discussion for gh-4879, there's a missing NULL check in Py2 pickle compatibility hack.