Eliminate the use of `extract()` in `wp_insert_attachment()`.

`wp_insert_attachment()` and `wp_insert_post()` are incredibly similar, but have branched logic. I have annotated many places where they diverge.

See #22400.


git-svn-id: https://develop.svn.wordpress.org/trunk@28470 602fd350-edb4-49c9-b593-d223f7449a82