Stability of capillary hypersurfaces in a manifold with density