Fix to potential unterminated loop if a delimited text file is deleted

Another try at fixing test cases with file watcher, don't work on some
platforms.
Fix for #7458, project crashes when loaded from command line

- Image selection previews now load only on first expansion of parent group box
- Note: this is an OK fix for 2.0 release. One better solution noted here: http://hub.qgis.org/issues/7458#note-12