Fix SQL bug in testcase
Add tile and grid fetching checks at layergroup creation time

Basically requires windshaft 0.12.6, which implements this