Pass the attachment ID to the 'image_add_caption_text' filter.

fixes #29607.
Built from https://develop.svn.wordpress.org/trunk@29754


git-svn-id: http://core.svn.wordpress.org/trunk@29526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Media Grid: 

* In Bulk Edit mode, don't attempt to delete or trash an attachment that doesn't have a `delete` nonce. The subsequent `_requery()` will then properly display the attachment still present in the library.
* Remove all updated models from the selection at the same time to avoid async race conditions. The selection is reset when the grid's `select` mode is deactivated, but this allows this view instance to be more portable.

This fix allows users to set caps on individual attachments without confusing the grid's library. This issue was present for bulk actions in general, had nothing to do with `MEDIA_TRASH` specifically.

Fixes #29597.

Built from https://develop.svn.wordpress.org/trunk@29755


git-svn-id: http://core.svn.wordpress.org/trunk@29527 1a063a9b-81f0-0310-95a4-ce76da25c4cd