Fix EZP-22854: updatesearchindex not committing at each iteration.

JIRA: https://jira.ez.no/browse/EZP-22854

The updatesearchindex.php should commit changes at each iteration and not at the end of the operation (much like the index cronjob and other scripts).