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.
--rebased-to #2406 rather loosely