brokenmalloc is a simple malloc wrapper which can be made to fail on demand