MDEV-6631

Only check query cache queries with SQL_CACHE when using DEMAND query cache