fix replaceAll()

This function will never return if new_value contains old_value.
For example, old_value = "'", new_value = "''".