Heat oil in a large saucepan over medium heat. Add caraway seeds and cook, stirring, until they start to pop and dance around in the pan, about 1 minute. Quickly add onion, leek, and a splash of water to keep seeds from burning; season with salt and pepper. Cook, stirring occasionally, until onion is soft, 5–7 minutes.