SphinxQL: Fix debug templates and check if its mysqli->connect returns null.