Thousands attend funeral for Iraqi legislator