randomlines more gracefully handles stdin and command line errors