Phase transitions in gold contacts to GaAs