Small performance improvement on Client write command

I moved the strlen to outside the for, check diff.