A burr under your saddle

Where did the expression "a burr under your saddle" come from?

I don't know who said it first. But it is literal -- a horse with a burr under its saddle will buck and kick. Generally act up.