Helper method to check and restrict socket name

ZMQ IPC socket paths limited to 107 characters in length. Thus we need
to check and restrict it.

Closes-Bug: #1367614
Change-Id: I5e7d379e543fd2fd14956482542fe074e9fbca17