[1.5.x] Added warning about get_inline_instances() permission checking; refs #23754.

Backport of e0d1f2684ae60573b209783f9fd4f9db163ad704 from master
[1.5.x] Fixed #23754 -- Always allowed reference to the primary key in the admin

This change allows dynamically created inlines "Add related" button to work
correcly as long as their associated foreign key is pointing to the primary
key of the related model.

Thanks to amorce for the report, Julien Phalip for the initial patch,
and Collin Anderson for the review.

Backport of f9c4e14aeca7df79991bca8ac2d743953cbd095c from master