Spanish police have arrested three men believed to be involved in carrying out cyber-attacks on governments and companies including Sony and MasterCard.