Store registered network callbacks and unregister all at tearDown

Add helper methods to register network callbacks and unregister
them all at tearDown to prevent missing unregisteration and causing
leak. This will also help to develop the follow up test cases.

Test: atest com.android.cts.net.HostsideVpnTests
Change-Id: Ifefee3f9bda63a9f45108516f86f2f5242c53bb2
1 file changed