Support output to streams other than stderr. Fix some warnings exposed by move to fprintf instead of warnx.