posix: tiptoe around tempfile module more delicately
Some of the values inside the tempfile calls here are str on Python 3,
so we've got to pass str in. Use fsdecode to work around the issue.
revlog: use int instead of long
By my reading of PEP 237[0], this is completely safe and has been
since Python 2.2.
0: https://www.python.org/dev/peps/pep-0237/