zdir: use S_ISDIR macro instead of masking yourself

For some reason zdir_test fails for me if run in gdb because it mistakenly recognizes a file as dir. Using the macro to test for dir fixes this. Don't ask me what is going wrong there but it makes sense to me to use the macro anyway.