Update update.php

Backport also this commit: https://github.com/joomla/joomla-cms/commit/ae96020c01f2d4ceffa90bb6232a5a21757f8b13