target/cortex_m: do not leak memory on reexamination