Central extensions of supersymmetry in four and three dimensions