Customize arrow path tikz

There are several ways of solving this, here is one using the |- path specification (meaning go first vertically, then horizontally, to the next coordinate) and one relative coordinate.

enter image description here

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,automata}

\begin{document}
\begin{tikzpicture}
   \node[state,initial,initial text=G] (1)   {$1$}; 
   \node[state] (2) [right=of 1] {$2$}; 
   \draw[->,rounded corners] (1) |- node[pos=0.75,fill=white,inner sep=2pt]{a} ++(1,1) |- (2);
\end{tikzpicture}
\end{document}

One could solve it - rather unelegant - with control points inbetween. I don't know why the last line is not perfectly horizontal, though.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,automata}

\begin{document}
\begin{tikzpicture}
    \node[state,initial,initial text=G] (1) {$1$}; 
    \node (ctrl1) [above=of 1, anchor=north] {}; 
    \node (ctrl2) [right=of ctrl1, anchor=east] {}; 
    \node (ctrl3) [below=of ctrl2, anchor=north] {}; 
    \node[state] (2) [right=of 1] {$2$}; 
    \draw (1) -- (ctrl1.south) -- node [fill=white] {a} (ctrl2.south) -- (ctrl3.south) -- (2);
\end{tikzpicture}
\end{document}

Screenshot