Fix 500 error on retrieving metadata by invalid URI

An invalid URI should return a BadRequest error rather
than making the metadata proxy bomb out.

Closes-bug: #1371160

Change-Id: Ifb495f9e8929062a0c24d090c3e702109a38803a
Merge "Fix 500 error on retrieving metadata by invalid URI"