rl_helper: add support to tab completer

When tab is pressed, we make a starts-with comparison and return the first
command that matches.
Fix wrong prompt_state/r_bd_addr placement

The prompt_state and the r_bd_addr variables were wrongly placed as
global, but we can put them inside userdate structure.
As a side effect, we need to initialize prompt_state calling
change_prompt_state with NORMAL_PSTATE parameter.
rl_helper: add ctrl-d parsing

When we press ctrl-d, the terminal send us an end-of-transmission
command. So we can exit from program.