Ensure SearchResultChartWidget query is not empty

Otherwise generating the histogram for the widget will fail. Fixes
Graylog2/graylog2-web-interface/issues/838