work on #2315: preserve corrupted database on SD storage
work on #2315: preserve corrupted database on SD storage

Also, switch the DB to internal storage if we could not use external one.

brok85/cgeo,SammysHP/cgeo,lewurm/cgeo,vishwakulkarni/cgeo,vishwakulkarni/cgeo,ThibaultR/cgeo,KublaikhanGeek/cgeo,schwabe/cgeo,superspindel/cgeo,vishwakulkarni/cgeo,cgeo/cgeo,S-Bartfast/cgeo,Bananeweizen/cgeo,lewurm/cgeo,samueltardieu/cgeo,pstorch/cgeo,KublaikhanGeek/cgeo,brok85/cgeo,Huertix/cgeo,schwabe/cgeo,mucek4/cgeo,marco-dev/c-geo-opensource,samueltardieu/cgeo,kumy/cgeo,brok85/cgeo,Huertix/cgeo,S-Bartfast/cgeo,tobiasge/cgeo,cgeo/cgeo,Bananeweizen/cgeo,tobiasge/cgeo,xiaoyanit/cgeo,madankb/cgeo,xiaoyanit/cgeo,ThibaultR/cgeo,rsudev/c-geo-opensource,S-Bartfast/cgeo,yummy222/cgeo,kumy/cgeo,matej116/cgeo,pstorch/cgeo,lewurm/cgeo,superspindel/cgeo,pstorch/cgeo,SammysHP/cgeo,rsudev/c-geo-opensource,mucek4/cgeo,auricgoldfinger/cgeo,marco-dev/c-geo-opensource,madankb/cgeo,SammysHP/cgeo,cgeo/cgeo,superspindel/cgeo,ThibaultR/cgeo,yummy222/cgeo,Huertix/cgeo,KublaikhanGeek/cgeo,marco-dev/c-geo-opensource,auricgoldfinger/cgeo,cgeo/cgeo,tobiasge/cgeo,matej116/cgeo,xiaoyanit/cgeo,yummy222/cgeo,madankb/cgeo,schwabe/cgeo,rsudev/c-geo-opensource,matej116/cgeo,samueltardieu/cgeo,schwabe/cgeo,auricgoldfinger/cgeo,kumy/cgeo,mucek4/cgeo,Bananeweizen/cgeo