Tracking the impact of environment on the galaxy stellar mass function up to z ~ 1 in the 10 k zCOSMOS sample