BUG: Fixed C code printing for Piecewise functions.

C code generation for Piecewise functions was not working for functions
with multiple conditionals. This patch fixes the unbalanced ending parentheses.
Merge pull request #7719 from woodscn/piecewise_codegen_fix

BUG: Fixed C code printing for Piecewise functions.