If MySQL timeout occurs, ping server and attempt reconnection

- Currently the mysql connection is made immediately and then
  the scrapping of the VCS starts

- If the scraping takes a long time then a timeout can
  occur for exampe in very large projects like mozilla

- When the timeout occurs then the analysis fails once the
  scraping is done and attempts are made to write data to the db

- If the exception for a lost connection is raised we now
  make a reconnection attempt and re-execute the query

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>
Check if database file is already in the directory

- Avoid recreating the database file if it is already present
  this part of the analysis can be very time consuming

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>