Close DB connections on all stop grading paths