Rigidity of closed manifolds under an integral pinching assumption