Fix engine hangs with Windows reserved file names
Created by: dragmz
This is an experimental fix for #20110 that uses GetFileType function to test the opened file type and fail if the type is FILE_TYPE_CHAR (https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletype#return-value)