close statement in MimeType detection is executed [#7069]

close statement was never executed due to it being after a return
statement.

fixes  [#7069]