libstd: handle rmdirZ INVAL error (#10145)

The INVAL error was marked unreachable which prevents handling
of the error at a higher level.

It seems like it should map to BadPathError based on the man page for
rmdir (and an incomplete understanding of DeleteDirError), which says:

```
EINVAL pathname has .  as last component.
```
89afd4bd33Jeremy Fillingim committed on 12/1/2021, 1:38:21 AM· committed by Andrew Kelleyparent1e0addc
1 file changedLine totals unavailable