The VNC password is stored in a file /System/Library/Preferences/com.apple.VNCSettings.txt It's encrypted somehow.
There are 3 other interesting files in here, but I'm not sure what we need to change in them to get this working:
com.apple.ARDAgent.plist
com.apple.RemoteDesktop.plist
com.apple.RemoteManagement.plist