Fix CtsWifiAwareTests broken by ag/33807039

Here we use the same event name for several network events, so when
waiting for event, we should check whether the callback name is onUnavailable or
onCapabilitiesChanged.

Bug: 424140970
Test: sponge2/f2515bb3-e801-4fa1-823b-4c19d1bd0dc2
Change-Id: I9e2323b6d3a8d3220c6e1545208a3cf7506cc80a
Flag: TEST_ONLY
1 file changed