Refactored thread safety implementation of method createClassName in order to improve its performance
Made classNamesCounter final to be sure it is not accidentally null in a concurrent situation: thanks to Jochen Theodorou for the review and suggestion