Fix LT-15558: Take a pessimistic approach to importing

* Create a failure file before importing and remove it after success

Change-Id: Ib5f354390654efb64dac4f0f1b342412dd6a27dd