fix crashes with MALLOC_DEBUG enabled that were a result of my recent thread