add some patches with fixes, partly queued upstream

Upstream migrated the old code base to github in 2011:
https://github.com/rafaelsteil/libcgi – I got the old ptxdist patches
merged in 2012 and two fixes for mem leakes as well. Today I made pull
requests for Michael's patch from last year and another fix of mine from
today. However I doubt the maintainer will do another release soon or
even at all, so I add my patches here, too. I'm sorry, I squeezed the
ptxdist patches into one upstream, so Robert lost his credit there, but
this is not topic of this series discussion. ;-)