Write valid free atom when -moov_size is specified.

Fixes ticket #3769.
Parse dri when receiving jpg via rtp.

Based on a patch by contact at iridiummobile ru.
Fixes ticket #3780.