Move check for baseline database in legacy_version.pl to top

Check for schema_change_log table first.