Symmetry breaking for a class of semilinear elliptic problems