Ensure flow control callbacks happen outside the transport lock.

Split encoding into two phases: a collection phase to decide on what is allowed
(by flow control) to be sent, and a framing phase when the data is actually
sent. Perform the second phase outside of the transport mutex (but serially,
guarded by t->writing) and make flow control callbacks during that phase.

This will allow us to make further transport level calls in response to flow
control callbacks, and will be needed by the forthcoming async api for C++.
	Change on 2015/01/12 by ctiller <ctiller@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=83774409
4 files changed