This covers the case where an AVD has an invalid target
or is missing its AVD folder or the config.ini in it.
Made some cosmetic cleanup too.
Original author: raphael
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...