The difficulty is that the NBSP seems to only "bind" to the following entity if the entity is text, and not an image element.
A solution I found if you know the size of the image is to add several NBSPs to the end of the text, and then place a negative margin on the following image, so that it occupies the space of the NBSPs. That way, the last word and the NBSPs constitute one unit that will wrap or not wrap all together, and if the icon is at a negative margin that is greater than the width of the NBSPs, then it will never get pushed to the next line before the last word of the previous text does.
Something like this should work:
<span>This is some text ><img style="margin-left: -15px;">
Alternatively, you can add padding to the text and a negative margin:
<span style="padding-right: 15px;">This is some text</span><img style="margin-left: -15px;">
(This is based on this answer: https://stackoverflow.com/a/25857961/5899236)