Fix compilation failure when readline is enabled

Fixes #277