Fixed double free issue in pua module

Also fix a couple of related memory leaks
Merge pull request #58 from saghul/pua_double_free

Fixed double free issue in pua module