use `type(obj) is cls` as switch when canning

`isinstance(obj, cos)` would trigger the canning shortcuts for subclasses,
which can be inappropriate (e.g. pandas.TimeSeries).

closes #2793