Cosmic ray electrons, positrons and the synchrotron emission of the Galaxy: consistent analysis and implications