added linux kernel style .gitignore file

because the default github .gitignore file sucks.
use snprintf instead sprintf

the maximum sysfs file path will be limited to 40, which is more than enough.
GPIO number is now limited to < 999, GPIO value limited to < 9.
split set_gpio_val callback

Especially for controlling the lcd, where we are toggling different gpio lines
hundreds of times in a second. It's better to keep the fd of the GPIO valud
entry around, instead of calling open/close every time when we want to access a
GPIO line. Hence the set_gpio_val callback is splitted into set_gpio_val_by_fd
and gpio_get_val_fd, which can be called independently. Also made change in the
lcd callback to make use of the new callbacks. An array of fds needs to be
created, some addition to close_lcd routine, nothing complicated.
minor changes in the main loop

make loop intervals build-time configurable. update lcd only if lcd control
enabled, also add some comments.