Add support for delayed tasks in MemoryQueue

`MemoryQueue` now uses a `DelayedTaskIterator` wrapped in a `PeekIterator`. `DelayedTaskIterator` takes care of tasks ordering taking delays into account.