lib/std: handle `last_error` for FileStat-related services in Path