Projection method for flows with large local density gradients: Application to dendritic solidification