Unlink import file when finished

fixes #2493
- Update db import version (in case it doesn't exist)
- Properly unlink file after import or error