Cleanup prompt() function.

- Only print the prompt after the allocation was successful.
- Rename to prompt_user().
- Free the memory allocated by it.

Signed-off-by: Thiago Farina <tfarina@chromium.org>