Several reference counting fixes that were badly affecting memory use

We love python-htpy :-) but we have been facing several problems when using it over python daemons or any way over long process runs. Even a simple "while True: cp=htpy.init()" can consume the available run pretty quickly. The reason for this is that in seval points of the code the reference counters were not tracked or updated correctly. This patch fixes these problems.

This is joint work by me and Davide Canali (dcanali@lastline.com).