Ex-Manchester United manager Jose Mourinho has avoided jail for tax fraud as part of a deal with Spanish prosecutors but will pay a fine of close to two million euros.