As I said below you should restore the entire array, not just the first element:
navigator.mozMobileConnections = realMozMobileConnections;