py3: replace file() with open() in test-convert-hg-source.t
file() is not present in Python 3.
It also makes sure we read and write in bytes mode on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2132
$ echo "[extensions]" >> $HGRCPATH
$ echo "mq=" >> $HGRCPATH
$ hg init
$ echo 'base' > base
$ hg ci -Ambase
adding base
$ hg qnew -mmqbase mqbase
$ hg qsave
$ hg qrestore 2
restoring status: hg patches saved state