Spin Self-Rephasing and Very Long Coherence Times in a Trapped Atomic Ensemble