metrics: deal with app and host names with a `.`

Do not allow dots in our app or host name substitutions, they mess up
the statsd metrics hierarchy, which uses `.` as a separator.

/to @rmg I don't see a way in here to add a test easily. This is what causes strong-pm's internal metrics to not work on mac's, the `os.hostname()` usually looks like `<machine>.local`. I haven't seen an appname with a `.`, but it is possible, and would also break strong-statsd's metric name parsing.