romfs: fix a use-before-set bug on checking the dirent