If you are on Delta metal, you will be out of Terminal 4. It is the ONLY terminal at JFK that Delta uses, and that goes for KLM as well. However Air France uses Terminal 1. So if your flight is marketed by Delta but operated by Air France, you will have the scenario you wish to avoid. But since you said the non-stop to Berlin, that is 100% going to be Delta, and 100% going to be out of Terminal 4.