Electronic structure and dimerization of a single monatomic gold wire