Stream management improvements

Includes improvements for higher level stream management as well as a few race condition fixes.
Fixes race condition around sending write and sending reply on remotely initiated streams.
Fixes race condition between handling child and parent stream frames.