Using a food processor, pulse the flour and salt until combined. Add the butter and pulse until the mixture resembles coarse crumbs. Add the egg and water. Pulse until the dough just begins to hold together. Remove and shape by hand into a disc. Dust lightly with flour, cover with plastic wrap and refrigerate for 30 minutes.
Roll out the dough and use it to line a 25-cm (10-inch) pie plate. Refrigerate for 30 minutes.
With the rack in the lowest position, preheat the oven to 190°C (375°F).
In a skillet over medium-high heat, sauté the shrimp, garlic and thyme in the oil for about 1 minute. Season with salt and pepper. Set aside and let cool.
In a bowl, combine the eggs and milk. Add the leeks and the shrimp. Adjust the seasoning. Pour the egg mixture into the pastry shell. Bake until the eggs have set, about 45 minutes. Let rest 10 minutes before serving. Serve with a green salad.