Pulsar distances estimated from the 21-cm absorption line