Make sure that metadata handler uses constant_time_compare()

This adds a test to ensure that the new behavior of the metadata
API handler persists. It's important that it uses the special
constant_time_compare() method.

Change-Id: I1253661f74dae822be9dc9fe1fdab861ebd64bc9
Merge "Make sure that metadata handler uses constant_time_compare()"