BUG-5626: refactor BehaviorStateHolder
This patch splits this class into two parts: BehaviorStateTracker, which is kept
around for as long as RaftActor lives, and BehaviorState, which is used transiently
when we are about to perform a state change.
This makes it more clear as to what state is required to perform a behavior change
and also prevents us from keeping potentially stale objects around. While it forces
object allocation in message dispatch, BehaviorState objects are extremely short-lived
and do not leak to the help -- hence JVMs should be able to deal with them quickly
during GC or even eliminate allocations based on escape analysis.
Change-Id: Ida23a0dcb75ab6ccd11afcc64742884214760549
Signed-off-by: Robert Varga <rovarga@cisco.com>