Adds MemoryCacheEntryPriorityQueue heap index checks

Resolves an issue with index overflows in GetHeapWithGrow, and potential issues elsewhere in the class.

This code is licensed under MIT X11 code.