Fix some broken cases of bind error reporting.

Reported by leont++.