univalue: make spaceStr thread-safe

Simply add spaces to the existing string instead of using a temporary.

Fixes #4756.

Tested with `src/bitcoin-tx -json -create`.

I don't get where this idea comes from. Why would copying be cheaper than just generating spaces on the fly? Memory access is *much* slower than computation.
And what do you think a copy does internally?