fix stderr locking and ferror semantics in getopt message printing