fix resource leak (fixes #8)

 * when ngx_open_file fails, NGX_INVALID_FILE should be returned.
 * return value of fdopen is fogotten to fclose
fix bug(imlib_save_error sometimes fails in highly-loaded)

cause -> The return value of imlib_set_image_format is null when jpeghint is 'y'.