stm32: fix invalid uart access
stm32: fix invalid uart access

This fixes and invalid access when only UART_1, or UART_2 are enabled.

The uarts structure in memory is allocated according to the number of
uarts enabled. When only UART_2 is enabled for example, only 1 element
of uarts is enabled, but when trying to access it the index 2 was being
used. This commit adds a helper function that fixes the indexing.

mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core