Implementation of a measurement-device-independent entanglement witness