Various RTMP improvements.
Fixed a few generic socket mistakes and uninitialized memory occurances.
Fixed uninitialized semaphore in shared memory code.