Set pin modes only when a new PWM pin is set, remove set pins mode from pwm_update.