Improve pushState, replaceState and routing for Themes page

* Uses `pushState()` generally
* Uses `replaceState()` when updating a search query (so no history cruft from typing)

fixes #27198. props gcorne, adamsilverstein.
Built from https://develop.svn.wordpress.org/trunk@27268


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