ios: Close open sockets on app reset/shutdown (Fixes #203)