Handle some stream delegate edge cases better.

The NSAssert in SPDYSessionManager in streamCanceled has been seen to
fire, so this change attempts to address those by very explicitly
managing the stream's delegate pointer when ownership of the stream
changes.

Also includes some unit tests covering these cases. They ended up
requiring a lot of set up code and internal knowledge, but it's
good enough for now.