Process readline buffer in separate thread

Doing too much work in the same thread as readline works causes long key
sequences to be split.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>