Close USB properly when premature end-of-file reached