Ford Focus II (07) 1.6 TDCI - Windscreen trim loose - lupofocus

Hi,

my Focus has a plastic trim around the edge of the front windscreen. It has popped out along the top edge and makes a whistling noise. I've tried pushing it back in but it just pops out again. Any ideas as to what would be safe to use to glue it back in? So far I've thought about using silicone sealer or plumber's mait. I'm not sure about either. Whatever I use it would need to be flexible, not cause any damage and not cause a problem if the windscreen needs replacing. Any recommendations?

Thanks