Add defensive checks when looking up attributes

Lookup of attributes is made more hardened, so we do not lose prefixes,
but only attributes in things go south.

Also adds an explicit argument check for null objectType to track down a
NPE we have been hitting.

Change-Id: I2eacc5c66cac747e1ebeb9d88367dcd1e4ea9281
Signed-off-by: Robert Varga <rovarga@cisco.com>
Merge "Add defensive checks when looking up attributes"