Fix COUNT error handling

- any error from the SQL query would cause exception to be raised rather
	than calling back with the error and giving the caller the opportunity
	to handle it.