release locks when quitting