Fix array overflow in gpio configuration code for NRF5x
Fix array overflow in gpio configuration code for NRF5x

Reintroduce PR #6021

https://github.com/ARMmbed/mbed-os/pull/6021

which was accidentally removed by PR #6711

https://github.com/ARMmbed/mbed-os/pull/6711

c1728p9/mbed-os,kjbracey-arm/mbed,kjbracey-arm/mbed,betzw/mbed-os,mbedmicro/mbed,andcor02/mbed-os,kjbracey-arm/mbed,mbedmicro/mbed,betzw/mbed-os,mbedmicro/mbed,andcor02/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,c1728p9/mbed-os,mbedmicro/mbed,betzw/mbed-os,betzw/mbed-os,betzw/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,betzw/mbed-os,andcor02/mbed-os,andcor02/mbed-os