Longitudinal double-spin asymmetry for inclusive jet and dijet production in pp collisions at sqrt(s)=510 GeV