Optimize x_fread to speed up the smbclient put command