jEdit has serious bugs in bufferio. If an exception is
thrown during the final stream write/read oepration,
following problems occur:
The contents of the original file are lost. For
this case, jEdit provides "two-stage save" option.
But if the backup options are also enabled, the
file is moved to backup. Then the original file
seems to disappear. Also the stream is left open.
The stream is left open.
This patch will fix these problems.