CodeTool: Enhancing Programmatic Tool Invocation of LLMs via Process Supervision