Understanding why resident doctors leave the NHS and what can be done to retain them: a realist synthesis