Refactor and cleanup of skinny session handling.

Major changes are to pull all packet reading functions into skinny_session 
and move timeout handling to scheduling arrangements. Thread cancelling is 
now undertaken directly rather than waiting for the read to timeout 
(cleanup is popped on thread cancel). Also added some keepalive timings in 
debugging messages.

Keepalive timeout has been increased from 1.1 by keepalive to 3 times 
keepalive. This seems to align (after keepalives stabilise) with when 
devices reset after not receiving keepalives. Probably needs more work, 
especially around the first and/or second keepalives that vary 
significantly by device and firmware version.

Review: https://reviewboard.asterisk.org/r/2611/


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@394147 f38db490-d61c-443f-a65b-d21fe96a405b
Fixed chan_skinny for systems were pthread_t isn't an int.

I'm looking at you, OS X.


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@394156 f38db490-d61c-443f-a65b-d21fe96a405b
Fix bridge tech write callback parameter name.

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@394158 f38db490-d61c-443f-a65b-d21fe96a405b