MDL-44270 files: handle drag-drop js error when event has null types

This can happen when the 'dragover' event fires as has been observed
in Safari. When the dataTransfer.types property of the event is null,
accessing types.length throws a JavaScript error.