MDL-44316 upgrade: fix to ensure upgraded and new installations have matching 'tag_instance' tables