prompt: fix memleak of empty strings

The readline-enabled version of read_prompt() was memleaking 1-byte when
readline() returned an empty string. Free it first to fix it.

Refs #302
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>