machine: Move gpio code to hw/core/gpio.c