close the file descriptor of framebuffer as soon as possible
change to output image data to file by using output_image_to_file function