Fix validation error for invalid field name in simple query

The field name validation code runs only in case of the operator that is
specified for the invalid field name, is 'eq'. Otherwise the validation
ends with an invalid operator error. The field name validation code was
modified to check the field name first and only checks the operators for
valid field names.

Closes-bug: #1294628

Change-Id: Id34ae882940b36dec3ea81043b0d29b996a38426
(cherry picked from commit 50cffbc08f24ff8e3935aabecdf4be0fb366116d)
Merge "Fix validation error for invalid field name in simple query" into stable/havana