Reset $wpdb->insert_id on a failed INSERT or REPLACE. See [24459] [24494].



git-svn-id: https://core.svn.wordpress.org/trunk@24872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fix potential SQLi through improper use of API functions.


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