Fix potential fatal error when upgrading WordPress database