cc2538: gpio: Bug fix and various improvements