Measurement of branching fractions for two-body charmless B decays to charged pions and kaons at BABAR