fix #12242: delete bad annotation links and annotations

Deletes inter-group annotation links and deletes annotations with a bad discriminator string as described in http://trac.openmicroscopy.org.uk/ome/ticket/12242 and https://github.com/openmicroscopy/openmicroscopy/pull/2369#issuecomment-41701620. To test, decide from those what this PR's code should delete, and see if it deletes exactly that when the server starts up.
--rebased-from #2401 rather loosely

*Update:* the actual deletion is now fairly well tested by @manics, the main thing to check now is that `DBEnumCheck` runs except when the server has the same Bio-Formats version as last time it started up and that `DBBadAnnotationCheck` runs only once ever.