mraa_gpio_context objects leaked

At the start of my looking to speedup mraa_gpio_dir, I found a few
places where a secondary mraa_gpio_context was always leaked and several
places where it could be leaked in error conditions.