[1.7.x] Fixed #22792 -- Updated checks for list_display_links in model admin

Backport of d8f19bb3b6 from master