sysfs: fix race between readdir and lseek