[Fix] Bugzilla #17897 - MemoryCacheEntryPriorityQueue throws out of boun...

...ds after shrink

- when MemoryCacheEntryPriorityQueue grows the timed items after a shrink
  the value of the member variable heapSize is wrong allowing an out-of-
  bounds exception which would normally be prevented by bounds tests
- A test case was added for the out-of-bounds exception