Fix most -Wparentheses warnings.

This fixes all of the -Wparentheses warnings except "suggest parentheses
around && within ||"; in my opinion, fixing those would make our logical
expressions harder to read, not easier, because of all the extra
parentheses.