Modify shutdown in semaphore.go to work at any number of arguments

Because shutdown in semaphore.go worked only at two arguments, I modified it to work at any number of arguments.