filetransfer: use backend write() API correctly