A maximum entropy principle in general relativity and the stability of fluid spheres