BUG: Bug in idxmin/max with object dtypes (GH5914)

closes #5914