From sea ice to turbine blades: stability and optimal fluxes in mushy-layer convection