Romo tosses two touchdowns, Cowboys beat Bengals 24-18