unistd::statOptional() implementation.