The social network has joined a legal battle to ensure the right to take a selfie inside the voting booth.