Fix -Wcast-qual warnings in sanitizers