util: Change file check fns to use a mode mask
Instead of using a custom way to chck file type, use the system
provided macros and a mode mask to decide when we want to check.
Additionally a mask also allows us to selectively check permissions.
Signed-off-by: Simo Sorce <firstname.lastname@example.org>
Reviewed-by: Pavel Reichl <email@example.com>