Issue 242

These patches fix the problem that might cause a stall when an unexpected initiation
happens during the wait of response.

I'll add tests latter.
But I don't have enough time today and tomorrow. So please review up to here.