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`.

Looking at the std::string API there seems to be an even better way:

    string.insert(string.end(), spaces, ' ');

Gotta test this :)