Fix db/upgrade.php for Moodle 2.x