PhoneGap: Wrap network interface in a try