[1.5.x] Fixed #19545 -- Make sure media/is_multipart work with empty formsets

Backport of 3fc43c964e from master.