pacman/util.c: fix segfault when replace in strreplace is NULL (cherry picked from commit 4c1820493860d57ba9b98760762e947a4367e34b)