MinGW readdir reimplementation to support d_type