Measurement of branching fractions and search for CP-violating charge asymmetries in charmless two-body B decays into pions and kaons