C++-ify path substitution code

I found some uses of xfree in the path substitution code in source.c.
C++-ifying struct substitute_path_rule both simplifies the code and
removes manual memory management.

Regression tested on x86-64 Fedora 34.
2 files changed