Detects readline automatically

This code works whether USE_READLINE is 1 or 0.