Fix image saving for streams with characters not supported in path names.

This commit fixes #4011.
OSD: The bounding rectangle was too small if "&" appeared in the text.
OSD: Sanitize the positioning of the text and its frame.

Displaying an identical message on top left or top right resulted in different frame size. Also improve the behavior when the text is too big to be displayed entirely.