SQLite multi-threading working

*maybe a bit over-complex, but works
Architecture not perfect... :-( but running ;-)

*closing connections in the end 
*todo: check if connection is still open