winhttp: Use return value of sprintf() instead of calling strlen() and simplify code.