Catch KeyError (#437) to ensure that an exception is not raised in a race condition