gpio: add more error checking for mraa_gpio_context

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>