viz: fixed memory leak, issue 3961

Viz module: fixed memory leak
http://code.opencv.org/issues/3961