Port of walletbackup.sh to Python.

Please use 'python2' explicitly, we've recently changed this for all tests