who ruled egypt at the time of the french invasion