XWIKI-9563: Extension install freezes under some circumstances
* Reuse the job status only if it corresponds to the current extension/dependency
* Make sure the Velocity macros that 'return' values don't have side effects (if there is an existing variable with the name of the 'return' variable then it is set to null).