BUG: f2py, fix decref on wrong object

missing brackets causes decref on an wrong object.
shows itself as abort with negative refcount in test_callback using
python-dbg.
Merge pull request #3731 from juliantaylor/f2py-negative-refcount-1.7.x

Backport PR 3728
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