Mark Cavendish has regained control of the Tour of Qatar and will take a narrow two second lead into Friday’s final stage.