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