Add a warning for possible direct access to $wp_query->query_vars

This is a cleaned up version of @david-binda's #165, with commits squashed.