Revert "Revert "Fix leak in videoEditor_renderMediaItemPreviewFrame""

This reverts commit 645e6e580f8fb955571c3041b77a9fcf3458e577.
Revert "Accelerate the thumbnail extraction when the sync-frame duration is long"

This reverts commit f1355f2c0423603f3f48a77268a24f7ff46b4f96.