Factor out error message printing differences between MIT and Heimdal