libtimeinstate: use std::optional

Simplify the interface and implementation of libtimeinstate by using
std::optional instead of output parameters.

Test: libtimeinstate_test passes
Bug: 78498733
Change-Id: I97b697c9b51c31245b3c141eff063eba865f5d73
Signed-off-by: Connor O'Brien <connoro@google.com>
(cherry picked from commit 4b9c498812c5f3635c941483a6fec19cb432bcb8)
Merged-In: I97b697c9b51c31245b3c141eff063eba865f5d73
3 files changed