Fix pip module for python 3

Pip module now sets VIRTUAL_ENV environment before calling pip. Otherwise pip doesn't work in pyvenv-created environments.

Prerequisite for #5494.