libio: Update internal fmemopen position after write (BZ #20005)