base: add CachedProperty.

Copy bionic's CachedProperty with some minor API tweaks, to allow for
efficient querying of properties that rarely change.

Bug: http://b/141959374
Test: treehugger
Change-Id: I4dfc3f527d30262b35e871d256cec69e69f2e1d7
(cherry picked from commit 891e6dad73699d7b67861705843f95ba19ca5c4d)
3 files changed