handle connection errors properly (fixes petehunt/PyMySQL/#89)