ast: do not dereference NULL td_proc in CTR statement
(cherry picked from commit 42f1054ef12d10f3ba46770b985a320b0ceb9f2f)