Millwall preserved their Championship status for another year despite slipping to a 1-0 defeat at Derby County.