Fix restarting of standard_services with invalid class characters

Closes https://cfengine.com/dev/issues/2404