tor-proto: Fixes/improvements to stream rate limiter
Various fixes and improvements, but the main two are:
- The token bucket is now refilled before changing the rate with
TokenBucket::adjust
. - Fixes a bug in
RateLimitedWriter::poll_write
where a bucket with a max of 0 can cause the writer to behave incorrectly.
@jnewsome Marking you as a reviewer since it's a follow-up to !3014 (merged).
/cc @dgoulet