Added catching of SIGHUP and SIGQUIT, otherwise killing the process will
not unexport the GPIO pin (as in #echo "17" > /sys/class/gpio/unexport)