Add MachineState.download_file utility function