Add parens on generated S patterns

This fixes an issue where generated S patterns would sometimes not be
parenthesized, leading to invalid patterns being generated. This
occurred even in tutorial code, like Parity.