work around buggy S_ISxxx(m) implementations