Fix use of ASAN build type

Python raises an exception if the key used to access a dictionary
is not defined, so we need to check for valid keys.

Change-Id: I7f9cf78d81433f3ff260178ebda06748ac75c806