SERVER-12117 fixed path checking when parsing projection on $where query