cfm: Extracts the cfm status in one function.

This commit adds a new function, cfm_get_status(), for extracting
all cfm status at once.  This helps avoid the sequence of lock
acquire/release in current implementation of status query.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto: Add separate functions for checking bfd/cfm status change.

Currently, ofproto_port_get_bfd/cfm_status() is used to check the
bfd/cfm status change and query the status change.  Users decide
what to do with the filled status struct based on the return value
of the funciton.  Such design is confusing and makes the caller
code hard to read.

This commit breaks the function into a status change check function
and a status query function, so that they become easier to read and
use.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
bridge: Make ovs-vswitchd run again if status_txn commit fails.

This commit adds logic that checks the return value of status_txn
transaction and runs the update again if the transaction fails
(transaction status is not 'TXN_SUCCESS', 'TXN_UNCHANGED', or
'TXN_INCOMPLETE').

To keep the code simple, the re-run of update on transaction failure
will extracts the status from all interfaces, rather than just those
that have status change.  Since the transaction failure is considered
to be very rare, such overhead is deemed to be affordable.

VMware-BZ: 1256577

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>