This is actually a matter of (different) goals and definition of done.
If the developer's job is to develop X feature, yes, this is highly frustrating, just like Sisiphus punishment. It can be perceive as a lie ("You said that US would be over after this modification") or lack of skills ("Why can't product owner just know what they want once for all ?"/"why didn't he anticipate ?").
If the developer's job is to help solve a problem as a member of the team ("increase the conversion on that page by 1%"), we are telling a whole different story. A user story become a step, not an aim by itself.
This is where product owners can make a difference. Tell your team about the user stories that worked and the ones that failed. Make the numbers always visible if you can.
Having to share this notion of success forces the product owner to think of the functionnal acceptance criteria for each user story early, with hard facts. You can't know if it is a success before actual users use your product. You can't say Bravo only because something is developed, you have to look at the real results.
I've met a developer who was daily scrutinizing the number of visitors and deals made. Guess what ? He didn't care when he had to re-do a feature. The US just was not "done" yet, in a business perspective.
It is a error to underestimate the power of feeling progress. We need to have things finished. To have that, we need explicit goals. How do YOU feel when you spend a week-end hanging around asking yourself what to do next, websurfing with no purposes ? When monday comes, you feel you've done nothing and this is not a good feeling (well most of the times).
The key here is planning. Planning is boring when someone else makes it for us but it becomes challenging when it's your choices. You can see your tasks being done one after another, it's very fulfilling.
Most of all, you keep the focus. You know you will be late if you go off topic for too long, you know that something else is coming after. This is some stress that makes you feel you are going somewhere. You are achieving something.
Beyond traditional project deadlines, setting goals for each day is a life changing habit. It can be during the daily standup meeting ("yesterday, I've done this; today, I will finish that" and NOT "I plan to start this") or more private on a sheet of paper. When I'm not sure where I'm going, I make a list and then I know. I can also organize it according to the contraints and hence, maximize the chances of success.
If you don't have goals, you can't fail (/can't see that you are failing) and you can't win (/can't see that you are winning). Besides, how can you reach something you don't see ?
So... do you make common goals with global acceptance criteria ? How often do you plan your day ? What kind of goals do you particularly like ? My goal for this evening was to write a blog post in english in one hour. Without that goal, perhaps I would save it for a third proofreading or put illustrations. This blog post is not perfect but it is live.