SSIS - The process cannot access the file because it is being used by another process
If the messages cites your ".ispac" file, you have an unclosed debug. Enter Task Manager and close the Debug Host.
This may be too obvious, but have you tried inserting a short delay to give the dataflow time to let go of the file? For example, insert an Execute SQL Task with contents like:
-- Wait for 1 second
WAITFOR DELAY '00:00:01'
Alternatively, you could handle the Failure Path and retry, perhaps after a delay.
I found this link by accident and posting this to help others that get here as well.
When using a Script task make sure you drop connection with Close() or use connection inside a USING().
The connection is held after the task is complete and until the whole package is complete unless you do either of the above.