Increase the result string reserved capacity for replace operations.

This allows to avoid memcpies when the the result string is longer than the
original string.