ENH optimize forward-backward algorithm for LCCRF

Training is about 5% faster.
only use safe_sparse_dot once in computing  w_update