ssh: fix deadlock during error path
ssh: fix deadlock during error path

Fixes golang/go#11882

If an error occurs during handshakeTransport.writePacket the lock may not be
released. Fix this by using defer rather than manually unlocking in all paths.

Change-Id: I0010284b4f7d99907c86b4c0e140ab6cf37b0441
Reviewed-on: https://go-review.googlesource.com/12888
Reviewed-by: Adam Langley <db68fba232b2c49ed3e9d3081df349dde7b61dfd@golang.org>

guaiguaihw/crypto,tca/crypto,mattharden/crypto,zj8487/crypto,golang/crypto,thomaso-mirodin/crypto,cmars/tools,ScriptRock/crypto,mattharden/crypto,thomaso-mirodin/crypto,golang/crypto,pki-io/crypto,kim-racktop/crypto,bford/golang-x-crypto,Carrotman42/crypto,tca/crypto,CodyGuo/crypto,kim-racktop/crypto,cmars/tools,zj8487/crypto,Carrotman42/crypto,bford/golang-x-crypto,ScriptRock/crypto,guaiguaihw/crypto,pki-io/crypto,cmars/tools,golang/crypto,cmars/tools,CodyGuo/crypto