Properly handle raw strings got from `curl -d'; fixed message length calculation.