BUG: Avoid ambiguous condition in GroupBy.first / last
- [x] closes #32123
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

This comparison `val == val` happens in a lot of these groupby operations but only seems to raise here in the presence of `NA`. Are we just always / mostly converting to numpy beforehand in the other cases?