Fixes a regression introduced with commit 31f4a5c0 ("[kfilemetadata] Make it compile without foreach").
Use the iterator value() instead of doing another lookup.
value()
Add test case.
cc: @dfaure