code: func (s *State) CloseDB() error {
  	s.dbCond.L.Lock()
  	defer s.dbCond.L.Unlock()
  	if s.stateDB == nil {
  		return nil
  	}
  	for s.dbUsers > 0 {
  		s.dbCond.Wait()
  	}
  	if err := s.stateDB.Close(); err != nil {
  		return err
  	}
  	s.stateDB = nil
  	return nil
  }
docs: // CloseDB closes the persistence DB, waiting for the state to be fully
  // released first.