Fix setting STM32 GPIO input/output mode.

Tiny fix so the previous changes to remove target dependant code in the core work correctly.