std: fix handling of EBADF error code

In the context of read/write it's ambiguous, means file was opened
without read/write respectively.
2b01764d86Andrew Kelley committed on 1/15/2026, 10:18:20 PMparentcb37a5c
6 files changedLine totals unavailable