SI-8954 Make @deprecated{Overriding,Inheritance} aware of @deprecated.

This makes sure that:
 - there is no warning for a @deprecated class inheriting a
   @deprecatedInheritance class
 - there is no warning for a @deprecated method overriding a
   @deprecatedOverriding method
 - there is no "deprecation won't work" warning when overriding a member
   of a @deprecatedInheritance class with a @deprecated member
 - the above works even if the classes/methods are indirectly deprecated
   (i.e. enclosed in something @deprecated)

This should remove quite a few useless deprecation warnings from the
library.