Degenerate bound states in the continuum in square and triangular open acoustic resonators