A kinematic method for shakedown and limit analysis of periodic heterogeneous media