fixed ordering of locking for global heap in mm_malloc