Avoid crash when switching to 2G/3G network.

Adding test that active APN array is not empty

Credit PE:
https://github.com/Buckmarble/platform_packages_apps_Settings/commit/cb8f4e78da27d4dfbc3806a87494eb348779ac91

Change-Id: I5a21b55dab90b1f016dd2909f679bd366bec46d8