Add a safe migration mode to the wiki migrator.

The safe migrate mode can be invoked by setting the
safe_migrate environment variable to 'true' on the command
line when running the task.

RAILS_ENV=production rake gitlab:wiki:migrate
Ensure old revisions are retrieved from the DB in the correct order.
Merge pull request #3719 from DanKnox/add_safe_wiki_migration

Add a safe migration mode to the wiki migrator.