Fixes coredump caused by passing nil to argument #1 of nativefs.getDirectoryItemsInfo().
Aside: An invalid arg #2 (filtertype) can slip by if the inner function doesn't iterate over any actual directory items.
Perhaps it would be better to type-check in withTempMount(), as that seems to be the source of the issue here and in getDirectoryItems().
Most incorrect types for 'dir' are caught deeper into the call stack, but passing nil causes a coredump. This type-check mirrors the behavior of love.filesystem.getDirectoryItems().