func Timeout: cancel goroutine if timeout