On the sign problem in the Hirsch-Fye algorithm for impurity problems