Disallow non-local returns in tryTest{}

Non-local returns will prevent the execution of the cleanup{}
block, which is too much of a footgun to allow. See the bug
for details of how it happens.

There doesn't seem to be a way to keep the nice syntax, allow
non-local returns and still guarantee execution of the cleanup
block in all cases. Thus, forbid non-local returns. Users can
still use return@tryTest to accomplish almost the same thing,
and the next patch will also let tryTest{} return its last
evaluated value, fixing remaining cases.

E.g.
tryTest {
  foo()
  if (condition) return result
  bar()
} cleanup {
  doCleanup()
}

can always be written

return tryTest {
  foo()
  if (condition) return@tryTest result
  bar()
} cleanup {
  doCleanup()
}

...and it's a rare case, so the additional syntax is acceptable.

Test: NetworkStaticLibTests
Bug: 207358921
Change-Id: I40443acf7e4d86813641adc877e27fb2334d0daf
diff --git a/staticlibs/testutils/hostdevice/com/android/testutils/Cleanup.kt b/staticlibs/testutils/hostdevice/com/android/testutils/Cleanup.kt
index fb45582..bacbbe3 100644
--- a/staticlibs/testutils/hostdevice/com/android/testutils/Cleanup.kt
+++ b/staticlibs/testutils/hostdevice/com/android/testutils/Cleanup.kt
@@ -76,7 +76,7 @@
 }
 
 @CheckReturnValue
-inline fun tryTest(block: () -> Unit): ExceptionCleanupBlock {
+fun tryTest(block: () -> Unit): ExceptionCleanupBlock {
     try {
         block()
     } catch (e: Exception) {