Return to the previous dir after installing plugins.

(cherry picked from commit 9ac64c5190daf55ead24445479faa518d6dabf4a)