Hertz agrees to buy Dollar Thrifty for $1.2 billion