[libc] Implement expected<void, E> and use it in internal utilities (#215020)

Add the expected<void, E> partial template specialization to support
functions that return an error on failure and nothing on success,
matching std::expected<void, E>.

I've used this to resolve a TODO in if_nameindex and converted a few
other simple internal functions (pwd_utils::open/close,
update_from_seconds, stat_via_statx).

Assisted by Gemini.

GitOrigin-RevId: 7e8f40bc658207c76da51ac6a3012942f033d91c
11 files changed