Fix GH-8366: ArrayIterator may leak when calling __construct() When we detach an iterator, we also have to delete it. Closes GH-8374.