Close file on invalid range (#15166)
Close file on invalid range (#15166)

* Close file on invalid range.

* Close on seek error

Co-authored-by: Andrew Thornton <6a547fdd28db89120bdd70d4af1f9ba672ccd43a@cantab.net>
Co-authored-by: Lauris BH <f3041c4c693c07149804ea655e75ee8bb856bd26@nix.lv>
Co-authored-by: Lunny Xiao <0b0704cdf8f0790c6f1df1f74c38be95a8917ed2@gmail.com>
cez81/gitea,go-gitea/gitea,go-gitea/gitea,vdbt/gitea,go-gitea/gitea,cez81/gitea,cez81/gitea,vdbt/gitea