Use calcLinearState in pairwise factor creation

Fixes https://github.com/pystruct/pystruct/issues/14 and boosts my hacking morale.