fix(checkName): Check for wellformed logical names (refs #4968)

Make CheckDoc::checkName() and Doc::setLogicalName() use the same
definition of a well-formed logical name.
Merge pull request #1282 from eguaj/3.2-A4968

fix(checkName): Check for wellformed logical names (closes #4968)