Avoid going over max service name length when renaming NSD services

As per  RFC 1034/1035, the max size of the label is 63 bytes. It should
also be guaranteed when the serviceName is renamed due to the conflict.

Bug: 265865456
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:de802c8dc4f59735730fc24b0ca05a73f92e4bb5)
Merged-In: I077d8abdb91071db62b9618d9918e3a12682aaf4
Change-Id: I077d8abdb91071db62b9618d9918e3a12682aaf4
6 files changed