Semidefinite Relaxations for Approximate Inference on Graphs with Cycles