CC-5121: fix some SQL statements not being escaped/prepared
Merge branch 'master' of dev.sourcefabric.org:airtime