Implementation of yz feature (issue #949)

Also fixes a couple of memory leaks I found when running valgrind.

See also related pull request of radare2-regressions