improve udev_example1.c, check if device is allocated and give some good comments