MULE-6831: Applications deleted when deployment fails

Creating anchor file on the application installation phase instead of during the start phase
(cherry picked from commit dcdbdd9)
(cherry picked from commit c5cda56)
MULE-6831: Applications deleted when deployment fails

Adding missing test file
(cherry picked from commit 52b2b73)
(cherry picked from commit 8c50363)