Fix SIGABRT when stdin is a regular file