Tory attorney general threatens to block Scotland’s reform of gender laws