perform necessary data retention writes when creating a metric

When we create a metric where the data retention is specified, we write it to
three places, retentions_idx, metrics_idx, and data tables.