api: check unit name on set operations
Merge pull request #869 from jonboulle/862_valid_names

api: check unit name on set operations