tracker-priority-queue: Check segments array bounds in peek function

Failing to do this will cause indexing outside the bounds of the array
when the priority queue is empty.
tests: Verify that tracker_priority_queue_peek can handle empty queues