Measurement-Device-Independent Entanglement Witness of Tripartite Entangled States and Its Applications.