Relativistic Feynman-Metropolis-Teller theory for white dwarfs in general relativity