Phase Transitions of Civil Unrest across Countries and Time