Create a new FileOutputStream from the RandomAccessFile's channel, rather than the file destriptor, as this should ensure that stuff is closed correctly