Switch to Zenoss 5 writeMetricWithMetadata() API.

Fixes ZEN-14629.