Allow offsets in end() and reset()

This fixes [bug 31375 ](https://bugs.php.net/bug.php?id=31375).

It adds an argument to `reset()` and `end()` to skip N elements from the start or end respectively. For example:

    $a = [1, 2, 3];
    reset($a, 1); // 2
    end($a, 2); // 1

Negative offsets are ignored, but perhaps it would be better to raise a notice?