api: properly use deprecated for class renamings
the deprecated decorator for classes does not return a new class, it only inject a modified new method, so we indeed need a new class object in this case of class renaming.
Migrated from D1735 (view on Phabricator)