Implements Queue.count().