Lead, follow or cooperate? Endogenous timing and cooperation in duopoly games