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 #3748 from charris/backport-1.7-3747

Backport 1.7 3747