Arduino Due analogRead() repeats itself

I figured out what the problem was and those who are working on the Arduino software already knew about the issue and fixed it in the source code available at github. I explained my understanding of the problem in the link.

http://forum.arduino.cc/index.php?topic=214925.msg1675861#msg1675861

The short version of the solution is to download the latest source from github and build it yourself.