restore stack before unmapping heap