Added proper testing of the end of quicktime video files.

https://github.com/Itseez/opencv/pull/1684