Fix issue #878

Added a sentence to check the slave's state in doReliableRegistration() to make sure that the function returns when the slave's state is TERMINATING.

See https://issues.apache.org/jira/browse/MESOS-878