toolbox: reimplement watchprops using __system_property_foreach()

Internally, replace the watchlist array with a hashmap since the array
assumes properties are enumerated in a consistent order and foreach()
probably won't.  (find_nth() never guaranteed this either but it usually
worked in practice.)

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit 389e358017ad15485f2bd9120feebfffa489131b)

Change-Id: I1db3137b130474f4bb205f01f0bdcf37cf974764
1 file changed