BUG: Generalize label type for `confusion_matrix`

Fixes: https://github.com/scikit-learn/scikit-learn/issues/1835