There's very little you can do to prevent this, but you can stand your ground, and simply insist on paying only the previously agreed on fare. I was scammed in Hue (not my favorite VN city), but I stood my ground, did not give in, and when the cyclo driver asked for considerably more than the original price, I told him to take me to the police station - he soon lowered his expectations!
I did something similar in a Hanoi cab, when the driver could not find the address on a business card, and drove in circles around the Lake. I demanded that he stop the cab, and told him I was only paying 50% of the fare. Yes, he locked the doors, but I rolled down the window, and started screaming for the police. Again, I only paid what I wanted to pay. YOU SHOULD TOO!
I believe that the cyclos in Hoi An are basically honest, and I was also not scammed in a cyclo in Hanoi.