T5872: further fixes to ipsec dhcp exit hook
(cherry picked from commit 92012a0b3db8e93b10db4137414073f0371ed8cc)