Efficient measurement-device-independent detection of multipartite entanglement structure