Thermodynamics of entanglement in Schwarzschild spacetime