We allow characters in the ID of an ILM policy that will result in an invalid snapshot name.

For example, an ILM policy with the name `mypolicy-*` can be created, however, the generation of the snapshot name in this line:

https://github.com/elastic/elasticsearch/blob/befb6faafc9fca327fd3cea2d0ab328a521c4e65/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java#L81

Results in the `mypolicy-*` being part of the snapshot name, which the snapshot service then disallows. We should strip these invalid characters from the snapshot name.
server/src/main/java/org/elasticsearch/common/Strings.java
* The content is not pretty-printed nor human readable.
     */
    public static String toString(ToXContent toXContent, ToXContent.Params params) {
        return toString(toXContent, params, false, false);
    }
    /**
     * Returns a string representation of the builder (only applicable for text based xcontent).
     * @param xContentBuilder builder containing an object to converted to a string
     */
    public static String toString(XContentBuilder xContentBuilder) {
        return BytesReference.bytes(xContentBuilder).utf8ToString();
    }
    /**
     * Return a {@link String} that is the json representation of the provided {@link ToXContent}.
     * Wraps the output into an anonymous object if needed. Allows to control whether the outputted
     * json needs to be pretty printed and human readable.
     *
     */
    public static String toString(ToXContent toXContent, boolean pretty, boolean human) {
        return toString(toXContent, ToXContent.EMPTY_PARAMS, pretty, human);
    }
    /**
     * Return a {@link String} that is the json representation of the provided {@link ChunkedToXContent}.
     * Allows to control whether the outputted json needs to be pretty printed and human readable.
     * @deprecated don't add usages of this method, it will be removed eventually
     * TODO: remove this method, it makes no sense to turn potentially very large chunked xcontent instances into a string
     */
    @Deprecated
    public static String toString(ChunkedToXContent chunkedToXContent, boolean pretty, boolean human) {
        return toString(ChunkedToXContent.wrapAsToXContent(chunkedToXContent), pretty, human);