[BUGFIX] Check earlier for existing while importing

To be sure that the correct already exising file is
used to match already added files we need to move
the existing file check a little bit up.

Change-Id: I5f9a2693f692a0f1e67e11e90eb112bd644372e5
Reviewed-on: https://review.typo3.org/30751
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer