No, you won't lose credits unnecessarily if a migration fails midway . The credit equals to each file size (thats about to get migrated) will be consumed only if the migration for that file was successful:
In other words If a migration fails midway, only the files that were successfully migrated will contribute to the consumed credit.