Retention of rising droplets in density stratification