Refactor internet connection check into utility function

The internet connectivity check will be required by multiple test
classes. Refactor it into a standalone utility function and port the
code to Kotlin at the same time.

Also, instead of asserting, make use of junit.Assume. This way when ther
is no internet connection the test won't fail but it will just be
reported as skipped

Test: atest CtsCronetTestCases
Change-Id: I170aa19e23a9532d84da72cbcec567b65519bb0b
3 files changed