Avoid a variable reuse in get_ostring_attribute
Avoid reusing the index variable for a length calculation in
get_ostring_attribute. Tomas Mraz's rewrite of both functions carried
the fix over from get_pstring_attribute, and added checks for NULL
extension values and extensions with multiple values; incorporate most
of those changes.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>