What you're seeing here is Peter Jackson adapting the films to try to make the plot more interesting, detracting from the books.
This is common occurrence in the films as Peter wanted to change the tone of certain scenes to build the tensions quicker than those in Tolkien's The Lord of the Rings
The phrase itself is not meant as an offence to the Riddermark, however in doing so creates early tensions and suspense in the films. The term Horsemaster occurs many times in the earlier versions of the Legendarium as a name for the Riders of the Riddermark and is used by Tolkien himself to describe the people of Rohan 1
Firstly, the exchange between Gimli and Éomer. (Apologies for the long passage, and the emphasis is mine)
“The Rider looked at them with renewed wonder, but his eyes hardened. ‘Then there is a Lady in the Golden Wood, as old tales tell!’ he said. ‘Few escape her nets, they say. These are strange days! But if you have her favour, then you also are net-weavers and sorcerers, maybe.’ He turned a cold glance suddenly upon Legolas and Gimli. ‘Why do you not speak, silent ones?’ he demanded.
Gimli rose and planted his feet firmly apart: his hand gripped the handle of his axe, and his dark eyes flashed. ‘Give me your name, horse-master, and I will give you mine, and more besides,’ he said.”
“As for that,’ said the Rider, staring down at the Dwarf, ‘the stranger should declare himself first. Yet I am named Éomer son of Éomund, and am called the Third Marshal of Riddermark.’
‘Then Éomer son of Éomund, Third Marshal of Riddermark, let Gimli the Dwarf Glóin’s son warn you against foolish words. You speak evil of that which is fair beyond the reach of your thought, and only little wit can excuse you.’
Éomer’s eyes blazed, and the Men of Rohan murmured angrily, and closed in, advancing their spears. ‘I would cut off your head, beard and all, Master Dwarf, if it stood but a little higher from the ground,’ said Éomer.”
The Two Towers - Book Three: Chapter 2, The Riders of Rohan
From this passage, we can see that PJ has clearly adapted the scene, from a discussion (albeit tense) about Galadriel and the Golden Wood, led to the threat of Gimli's head being cut off. Being named horse-master had in no way insulted Éomer, however being told he had "foolish words" was clearly the trigger here.
As for the passage with Saruman, again it is PJ twisting the original scene. In this case it is likely to build up to the death-by-a-wheel he has planned for Saruman in the Original Cut and needs the tensions to be high enough for it to seem natural that Saruman has died. In the novels however, it is Théoden who declares himself "A lesser son of great sires".
“So much for the House of Eorl. A lesser son of great sires am I, but I do not need to lick your fingers. Turn elsewhither. But I fear your voice has lost its charm.”
“Now his voice changed, as he slowly mastered himself. ‘I know not why I have had the patience to speak to you. For I need you not, nor your little band of gallopers, as swift to fly as to advance, Théoden Horsemaster.”
Before Saruman's "voice change" he went insulting the Horselords and their ancestors saying "What is the house of Eorl but a thatched barn where brigands drink in the reek...". Saruman however collects himself from the outrage infused by Theoden breaking Saruman's spell and returns to trying to use his words to win them again. Whether "Horsemaster" in this case is insulting I am unsure. It seems as if Saruman has the intent of insulting Théoden, however whether Théoden takes offence or not is unclear, especially since he goes on to talk to Gandalf and the conversation moves away from Théoden.
Trotter (Aragorn) uses it in its first instance to describe the land of the Riddermark after the three companions chase Merry and Pippin into the plains.
“You are looking out across the great pastures of Rohan, the Riddermark, land of the Horsemasters,' said Trotter”
Treason of Isengard: Chapter 17, The Great River
Some more instances of the term "Horsemaster" are listed below.
Of old all that lay between Limlight and Entwash belonged to the Horsemasters' (FR: 'all that lay between Limlight and the White Mountains belonged to the Rohirrim').
Treason of Isengard
In earlier drafts we see the above exchange to be slightly different.
“Give me your name, master of horses, and maybe I will give you mine, and other news,' answered Trotter.
'As for that,' said the rider, 'I am Eomer son of Eomund, Third Master of the Riddermark. Eowin the Second Master is ahead.”
There are more examples, but all descriptions of the Riddermark as opposed to insinuating insult.