Add debugging for invalid free pointer on linux