Fix possible buffer overflow in RTMPSession
Cleanup keyframe logic
Cleanup branch for merge