nn_fsm alternates between IDLE and ACTIVE states

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
nn_fsm_isstopped function added

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
nn_fsm used to determine whether state machine is actually stopped

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
nn_ep turned into formal state machine

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>