internal helpers: fix error management in replace_cmd_parameters().
purge: allow custom purge command.

Allow defining a purge command (parameter purge_parameters::purge_command)
instead of performing 'unlink' action as built-in.
Purge command can take custom parameters like {path}, {fsname}, {fid}.
Added non-reg tests for this feature.