Cast uid/gid proxies to int for Python 3.4.

See http://hg.python.org/cpython/rev/f871f8662509.