Search for pair production of first- and second-generation scalar leptoquarks in pp collisions at sqrt[s]=7  TeV