Teslagrundaren Elon Musk ska flytta SpaceX och X:s huvudkontor till Texas, i protest mot Kaliforniens nya lag om könstillhörighet.