Fix calling support for calling close while not handshaked and calling close while closing.
Merge branch 'fix-close'