Add double-free detection code to the pools