core: Workaround bug in sqlite 3.6.12
core: Workaround bug in sqlite 3.6.12

Apparently select count(*) on an empty sqlite_master table triggers bug #3774.
Used another query to check if there is data in that table which won't make
sqlite 3.6.12 crash.

Tarnyko/rygel,jku/rygel,jku/rygel,Pelagicore/Media-Manager-Rygel-patched,GNOME/rygel,luisbg/rygel,GNOME/rygel,GNOME/rygel,Pelagicore/Media-Manager-Rygel-patched,Pelagicore/Media-Manager-Rygel-patched,Tarnyko/rygel