[Bug 53677] invalid O_WRONLY read sets errno=EACCES instead of EBADF