Change worker name constrant (#25780)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25780
support "trainer:0", "server:1" format
Test Plan:
# Unit tests
```
buck test mode/dev-nosan caffe2/test:rpc
```
Differential Revision: D17228907
fbshipit-source-id: a6e759f4364548454ab0f2907707e738997bbf38