Rekindling sectarian rivalries at a sensitive time, Iraq’s parliament on Saturday voted to fully legalize state-sanctioned Shiite militias long accused of abuses against minority Sunnis, adopting a legislation that promoted them to a government force empowered to “deter” security and terror threats facing the country, like the Islamic State group.