The dissolution of polar ice into a stratified ocean