Try/catch around ping, where sockets may close near program exit