add synchronization between ranging and keepalive connection

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>
merge conflicts solved

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>
try to solve null device

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>
correct problem name null

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>
correct problem disconnect and crash

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>
final version

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>