util.indexedbheap: Fix a possible traceback when removing the last item.