This is counterpart of 5774c78 "qfile-agent: move data handling code to libqubes-rpc-filecopy" in core-agent-linux. The main purpose is to easily reuse the code in dom0 qvm-copy-to-vm tool. QubesOS/qubes-issues#1324