libpcp: plug memory leak in derived metrics error handling
libpcp: plug memory leak in derived metrics error handling

BZ #1331973

Error handling needs to recursively free the current node, since it
may have been built recursively, so call free_expr() instead of free()
in the appropriate places where a derived expression fails. The patch
also fortifies free_expr() itself a bit.

Passes qa for group 'derive', and Frank's valgrind repro script passes
now too. A new QA test should probably be added.

BTW, this is not a regression per-se - the leak has always been there -
it's just more noticeable now that global derived metrics defs are loaded
by default.

adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp