Modify shutdown 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.