go.crypto/ssh/terminal: add support for BSD variants LGTM=agl R=golang-codereviews, agl CC=golang-codereviews https://golang.org/cl/97850043