Fix python proxy to not crash when fed unicode data in getstate and setstate.