DB: Use COUNT(*) instead of numRows()

ownCloud's internal ```numRows()``` function is not ideal and will most
likely be deprecated in the future. Use the database internal COUNT(*)
function instead.