Removing extra mutex lock in ClassServer::getNumberOfClasses() - not needed

Removing extra mutex lock in ClassServer::getNumberOfClasses() - not needed
Two calls to it in loops were changed, just in case. Anyway, maybe these should be marked as todo, because the number of classes may change while the loop executes.