Refs #1708. Restore disappeared subpages, which its parent page was top_page and was deleted.
fixed upgrade script - was skipping pages because we were changing the results between calls to ElggBatch