Process the flour and butter in a food processor until the mixture resembles fine breadcrumbs. Add 1-2 tbsps of cold water. Process in short bursts until the mixture just comes together, adding a little extra water if necessary.
Turn out onto a lightly floured surface and quickly bring together into a ball. Cover with plastic wrap and refrigerate for at least 30 minutes.
Cut the beans into short lengths. Heat the oil in a wok or heavy-based frying pan. Add the curry paste and cook for 1 minute, stirring constantly. Add the coconut milk and ¼ cup of water and bring to the boil.
Add the chicken and beans and stir through. Simmer gently for 15 minutes, or until the chicken is cooked. Add the fish sauce, lime juice and sugar.
In a small bowl mix together the cornflour and 1 tbsp of water to a smooth consistency. Add the curry and stir constantly until the sauce thickens and begins to bubble. Divide the mixture between four ½ cup capacity ramekins.
Divide the pastry into 4 equal pieces. Roll each piece between two sheets of baking paper until it is slightly larger than the top of the ramekins. Brush the edges of the ramekins with the beaten egg and cover with the pastry. Press the edges around the rim to seal. Trim off any excess pastry.
Cut a small air hole in the top of each pie to allow the steam to escape during cooking. Brush with beaten egg. Place the ramekins on a baking tray and bake for 20-25 minutes, or until the pastry is golden brown. Serve immediately.