Admittedly a crazy idea.
What if instead of going to war with the Barbary States, the new US formed an alliance with them?
In 1800, Napoleon doesn't take a conciliatory stance with the US, and the Quasi-War continues. Furthermore, over the next decade, Anglo-American relations continue to thaw...