Using Java Semaphore to run a limited number of threads at the same time