Does the job title 弼马温 really signify 辟马瘟 'avoid horse fever'
The ancient Chinese did keep monkey in their stables,

But they actually keep female monkeys, as they believe their menstruation can prevent horse fever (馬廄畜母猴辟馬瘟疫,逐月有天癸流草上,馬食之永無疾病矣)

By assigning Sun Wu Kong to a female monkey's title, it is probably a subtle joke from the author.