stmhal: Fix edge case for timer PWM of 100%.

Also improve precision of calculating PWM percent in integer mode.
Also update teensy with edge case fix.