libtimeinstate: check for invalid buckets when reading map

The indexing logic in getUidsUpdatedConcurrentTimes relies on the keys
read from the BPF map being valid and assumes that the maximum bucket
number is determined by the number of CPUs. Add a check to fail
immediately if an invalid, higher bucket is encountered.
Also add a new test in libtimeinstate_test to check this case.

Test: added test case passes only if the check is present.
Bug: 166696502
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I129a3b6491c869124dbbf5c694f82def9d5a8c98
2 files changed