Well, in the simple sketch given above, pin AO status is not configured in any way... It is NOT safe to assume that just using readAnalog() will do anything with regards to port direction or pullup registers - it wont.
It cannot hurt to try what I suggested. I find sometimes it is best to not assume that the Arduino environment or microcontroller after reboot sets the pins in the state you want, but explicitly ensure they are in the state you need. Sure, once everything is working and you are struggling for code space you can start trimming it out and see if it still behaves, but for now be explicit.
Eliminate the possibilities and things you have control over when troubleshooting - then you can chase down all the other unknowns.