Fix leaks in the object stack

This patch fixes some leaks in the object stack when getting various
class properties. With this fix an assert can be added to verify that
the object stack is clean when a thread is exiting.
Merge branch 'master' of git://github.com/steveicarus/iverilog