I certainly have no problem sending pirates to Davy Jones' locker. But you have to catch them first, and since they come to the ships, it seems simple and reasonable to wait for them to come to you so you can shoot them and sink their boats. Not rocket science.
Small unit tactics. This type of situation resembles an ambush. There are many ways to avoid an ambush or to win an encounter. The first is, as you have said, eliminate the source. They come from the Somali coast. But as you note, the Somali government is weak - practically non-existent to be honest - and they cannot control their own port security. Nor do we have the manpower to patrol the coast of the entire nation; small boats can launch from practically anywhere, you're not talking about deep-water ports here. If you can't stop an ambush at the source, you can plot their route and ambush them instead. The problem with that is that we're talking about water here. No natural terrain, no route they must take in order to reach you. It would still be worth putting some thumbtacks in maps to determine point of origin and point of contact for as many attacks as possible; if a pattern emerges, then an ambush at that site would be a lovely use of a small US Navy vessel. However, barring that, the best thing to do is to know you're going to be ambushed and be ready so that you're not surprised when it happens.
In the more general sense, Somalia is a strategic issue for us, but we've been badly burned there. The Al-Shabab Islamist movement has linked up with AQ (as I said they would too) and is now in control of major segments of the country. They offer the Somalis a choice that many are glad to take - they wipe out the warlords in exchange for conversion to Islam and agreeing to follow Sharia law. Remember this; no matter how bad Islamists are, they bring peace to the nations they conquer. Not freedom, not the kind of society most of us would want to live in, but peace, because the destroy anyone and anything that disagrees with them. When you're living in a war-torn and starving nation, peace may seem preferable, even if you lose your freedom (which most of them don't have anyway). We have limited influence with the Somali government, but mostly, we've ignored them. We do so at our own peril; not just because Somalia is a haven for pirates, but because it will also soon be another Afghanistan, a haven for terrorists-in-training. With Al-Shabab all chummy with AQ, we've got storm clouds on the horizon. I have said this before; no one listens. We'll listen when we're attacked by terrorists trained in Somalia, and then it will be "Why didn't we do anything about it if we knew?" Mainly because we're idiots, that's why.