Daniil Medvedev destroyed his racket and a net camera in a mid-match meltdown as he survived a huge scare against Thai wildcard Kasidit Samrej.