fixed several memory leaks

And infinity loop in stanza_destroy_form().
fixed memory leaks in presence.c