Additional error handling for copy_file (wallet backup), copied from Bitcoin source
Merge remote-tracking branch 'upstream/master' into testing