lib/loopdev.c: reset errno before strtol() call

Fixed unsuccessful attempt to find unused loop devices if 0-7
devices already used and /dev/loop directory exists.