Fix error handling in gpio.OpenPin
Added test helpers