Potlatch uploads ways with duplicate nodes in the end & connected to another way

Description

I just uploaded a changeset fixing invalid data uploaded by Potlatch 1.2c. A user who was editing residential ways managed to upload data where what should have been 2-node ways were 3-node ways with the last two nodes (where they way connected to another way) being duplicates (the same ID). Here's an example.

This probably happened when the user double-clicked over-enthusiastically when ending the way, so Potlatch should either fix up its double-clicking behavior or automatically fix these sort of errors in the data when uploading ways.