BUG: use correct type for hash values

As of Python 3.2 hash values are of type Py_hash_t. Previous versions use C long.
Merge pull request #3749 from charris/backport-1.8-3747

Backport 1.8 3747