gpio.c: close fd in mmap function

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
spi.c: destructor now freeing memory

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