Spontaneous symmetry breaking of self-trapped and leaky modes in quasi-double-well potentials