Ibrahim Pasha finally faced defeat where?