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

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

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