Avoid a fatal error in wp_reset_postdata() if $wp_query global is not set.

see #26775 for trunk.
Built from https://develop.svn.wordpress.org/trunk@26932


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