Fix c-code generation for nested conditional functions

C code generation did not work for nested Piecewise functions, I replaced the code generation from generating

p = ccode(2*Piecewise((x, x < 1), (x**2, True)))

---- original ----
2* if (x < 1) {
   x
}
else {
   pow(x, 2)
}

to

---- new ----
2*(x < 1) ? (
   x
)
: (
   pow(x, 2)
)