This looks like cargo-cult programming to me. stderr is almost
always line-buffered, making these fflush'es pointless. If it's
not line-buffered, that's probably because it's going to a
noninteractive destination for which this wouldn't matter.
Moreover, none of our other programs do this.
regards, tom lane