gpio: Use up to 8 GPIOs

Since they might not all be available, we need to do a bit more work
to not fall down in mixed configurations.
gpio: Add GPIO state getting API

Both single GPIO and a bitmask of all 8 supported pins
gpio: Add pin number checking for release builds.