If the control was ever passed an explicit parent, a potential memory leak
would happen, as the game list wouldn't be freed.
However, in our case, the game list was placed within a layout, which
automatically performs reparenting, avoiding this issue.
ForeachDirectoryEntry didn't actually do anything with the `recursive`
parameter, and the corresponding callback parameter was shadowing the
actual recursion counters in the user functions.
Fixes#1115.
Also improves the performances of DiskArchive’s directory
implementation a lot, simply by not going through the entire tree
instead of just listing the first level files.
Thanks to JayRoxFox for rebasing this on current master!
ScanDirectoryTreeAndCallback, before this change, coupled error/return
codes and actual return values (number of entries found). This caused
confusion and difficulty interpreting the precise way the function
worked.
Supersedes, and closes#1255.