Semaphore implementation in golang