stm32_serial: release GPIO pins when closing port