Castro Georges, Psychiatre à Foix