The uncle puts in another horse for the share, and now they have a total of 18 horses. So, by the will of the farmer:
1) The eldest son gets 9 horses.
2) The middle son gets 6 horses.
3) The youngest son gets 2 horses.
They have shared 17 horses, and now the uncle can take back his reaming horse out of the share. Note that this only works because a half, plus a third, plus a ninth doesn't total up one unit.