core: Fix templates search query

This patch improves the performance of the SearchQuery mechanism
for the vm_templates view

Change-Id: I0ef77348bc6126f5b038e40d949de6d5804def5f
Bug-Url: https://bugzilla.redhat.com/1061185
Signed-off-by: lzelkha@redhat.com <lzelkha@redhat.com>