Header pin plastic sliding off stripboard
40W is MUCH too much heat for small pins. The reason it barely melts the solder is because you haven't kept it clean and tinned, and the tip has probably burned. I suggest getting a new iron and TIN the tip IMMEDIATELY, while it's heating up for the first time. A 15-watt iron will be sufficient for soldering pin headers like you showed in your question. A tinned tip will allow the heat to be transferred to the pad and to the pin, allowing solder to flow properly. 

Right now you're using way too much heat, and it's melting the plastic around the pins. Soldering of a single pin should only take a couple of seconds maximum with a proper clean, tinned tip. That is not enough time for the plastic to melt.