packer/rpc: fix crashes with big file uploads [GH-897]