core: fix tests for nm_utils_shorten_hostname()
The test currently fails on systems where HOST_NAME_MAX != 64 (for example, Alpine Linux). Update the test to not assume a predefined maximum length.
Fixes: 94987022 ('core: add nm_utils_shorten_hostname()')