handle case of failure during compile phase

Guard against attempting to emit metrics and events for attributes that
may not exist due to failures in early phases of a Chef run.

Fixes #51