Fix use after free in redpile_cleanup