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