Integrating Action Knowledge and LLMs for Task Planning and Situation Handling in Open Worlds