Fixes for teardown in py.test call hook (issue #98)

These changes should fix the 2 bugs mentioned in issue #98.