In a medium heatproof bowl, whisk together the sugar, cornstarch and salt. Whisk in the whole egg and egg yolk until smooth. In a saucepan, bring the coconut milk and heavy cream just to a boil over moderate heat. Gradually whisk the hot liquid into the egg mixture. Pour the pastry cream into the saucepan and cook over moderate heat, stirring, until very thick and close to a boil, about 5 minutes. Remove from the heat and stir in the butter and vanilla, then add the coconut. Let cool briefly, whisking occasionally. Press a piece of wax paper directly on the surface and refrigerate until chilled, at least 3 hours or overnight.