Make sure we don't truncate the file on open before we have checked the sharing modes (thanks to Dmitry Timoshkov for the test case).