chimera: fix inode type detection

types socket and directory have an overlapping bit.
this makes checks like

(X & IFDIR) == IFDIR

to evaluate as true for sockets and process them a directory.

Use a type mask and change check to
(X & TYPE) == IFDIR

Acked-by: Gerd Behrmann
Target: master
Require-book: no
Require-notes: no