Don't pass FILE_FLAG_OVERLAPPED to CreateFile()
When a FileStream is opened with the FileOptions.Asynchronous flag set the
code in file-io.c will pass FILE_FLAG_OVERLAPPED to the CreateFile() function.
On Windows this means the file will be in asynchronous mode and when
ReadFile()/WriteFile() are called an OVERLAPPED struct has to be passed. Mono
doesn't do this which means that when reading/writing asynchronous FileStreams
Windows returns an ERROR_INVALID_PARAMETER and an exception is raised in
managed code.
This patch simply removes the code which passes the FILE_FLAG_OVERLAPPED to
CreateFile(). This will work since asynchronous I/O is handled in managed code
anyway, using threads. On the OS level the I/O is still synchronous. The patch
won't affect other platforms since the implementation of
ReadFile()/WriteFile()/etc in mono/io-layer/, which is used on non-Windows, is
always synchronous and ignores the FILE_FLAG_OVERLAPPED.
This bug was triggered by the
MonoTests.System.IO.BinaryWriterTest.AsynchronousModeWrites test.