estream: Fix assertion failure due to es_flush.
* src/estream.c (es_writen): Set writing flag even if no data was written.
gniibe tracked the problem down to a fully valid change in GnuPG
(gnupg commit 12af2630cf4d1a39179179925fac8f2cce7504ff). He wrote:
This is the first instance for estream to do READ and WRITE
(in the history of the code > 10 years :-). In the [gnupg] function
agent_write_private_key, the pattern is:
es_fopen es_fread es_fseek es_fwrite
which should work well, but if results core dump by assertion failure
in the function es_flush of libgpg-error.
- GnuPG-bug-id: T2371
- Signed-off-by: Werner Koch <email@example.com>