Optimal liquidation in a finite time regime switching model with permanent and temporary liquidation impact