Fix memory leak in r_core_cmd_subst

A little bit of memory leaked there.