Propagate transport fail state (e.g. 500)

When the state 'TRANSPORT_FAILED' is raised it is propagated to the listener. This would allow to subscribe to a onError callback in javascript for example:
https://github.com/ging/licode/blob/master/erizo_controller/erizoJS/erizoJSController.js
```
wrtc.init( function (newStatus){
          var localSdp, answer;
          log.info("webrtc Addon status" + newStatus );
          if (newStatus === 102 && !sdpDelivered) {
            localSdp = wrtc.getLocalSdp();
            answer = getRoap(localSdp, roap);
            callback('callback', answer);
            sdpDelivered = true;

          }
          if (newStatus === 103) {
            callback('onReady');
          }
         if (newStatus === 103) {
            callback('onError');
          }
        });
```
Add the stream when ice negotiation finishes.

When it takes longer to send the 'ok' message over socket.io than it
takes to move the ice connection into the complete state, we end up
failing to notify everyone else in the room that there is another
stream.

Instead of waiting for the 'ok' message, create the stream when the ice
connection moves into the complete state. This eliminates the race
condition and ensures that a connected stream is always fully published.

The other side effect here is that the 'ok' message is no longer needed.
I left it for compatibility, but it can easily be removed.
Fix to address a deadlock that happens sometimes when ice negotiation fails.  updateIceState fires an event holding stateMutex_, and that causes a lock with the WebRTCConnection class.  Also, clean up some vestigial junk, make locking more granular (we were holding nested locks to check ice state, for example--putting the lock after checking ice state removes that issue), etc.
Remove a bunch of unnecessary manual locking.  When using RAII objects (like unique_lock, for example), when the object goes out of scope it automatically unlocks.  So there's no need to do this before a return statement, before going out of scope (e.g. inside a while loop), etc.
Fix two problems:
1. Local candidates were put into a global variable, which means they could be overwritten and broken by simultanious calls to fetch local candidates.
2. Was not deallocating memory from nice_agent_get_local_candidates
Fix a memory leak in DtlsSocket where it was not calling X509_free(). Also remove some unused functions, get rid of C-style variable declaration.
Merge pull request #180 from jnoring/master

Some mutex cleanup, fix for a deadlock
1. Fix a leak with g_base64 encode/decode use.
2. Remove unused generateBase64Key() call.
Merge pull request #181 from jnoring/master

Memory leak fix
Merge pull request #175 from francoisTemasys/patch-1

Propagate transport fail state (e.g. 500)
Added timestamp to stats events
Merge pull request #177 from byronclark/eliminate-publish-race

Add the stream when ice negotiation finishes.
fixed issue with firefox publisher delivering black screens
addressed some issues when sending json objects when strings were expected
Merge branch 'K-GmbH-firefox'
Merge pull request #186 from K-GmbH/jsonparse

addressed some issues when sending json objects where strings expected
Merge remote-tracking branch 'master/master'