Cache signature of an empty label set

This is an optimization of labelsToSignature to avoid excess allocations
when the label set is empty.

Change-Id: If2d59bbc3ae6d4457e2ded197b6f4e7c67e6a173
Merge "Cache signature of an empty label set"