bionic tests: migrate gethostname test to unistd_test.cpp from system/extras

The old tests are implemented in file
    system/extras/tests/bionic/libc/common/test_gethostname.c
Here migrate the test to the tests/unistd_test.cpp file and
add some more checks

Change-Id: Iab1e3da873bb333d1ddefc03108d536933792db2
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
gethostname.c: change to report ENAMETOOLONG error when buflen is less

change to behaviour the same as glibc for the check about buflen

Change-Id: I98265a8fe441df6fed2527686f89b087364ca53d
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Merge "bionic tests: migrate gethostname test to unistd_test.cpp from system/extras"
Merge "gethostname.c: change to report ENAMETOOLONG error when buflen is less"