datapath: Fix use-after-free error in datapath destruction.