Auto release lock on child exit