Same-sex marriage laws could be amended ahead of High Court legal challenge