wait running goroutines before exit