python: solve binary tree postorder traversal