moved exitearly check after iodev_init(), as otherwise iodev_term() segfaults.