In `update_meta_cache()`, ensure that meta is always stored in the same order. Removes an unnecessary `$wpdb->prepare` statement. Adds unit test.

Props mattheu.
Fixes #25511.


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


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