Revert 622b05aa3131d646038522e762e90b1b4ea3b917

It turns out that 0-bit prefix is wrong, and the author now
clearly stated that the intention is 8-bit prefix for 8+ fields.
Fix out of bound array access in decode_length
Fix outbound flow control count

We wrongly added the whole payload length even if we sent part of it.