Import readline only in interactive mode

Fix: MN-1470
Merge pull request #136 from midokura/MN-1470

Import readline only in interactive mode