Don't read uninitialized memory
Add missing return type declaration
Remove stb_readdir_size which was written (on windows) but never read
Ensure GCC that p is not used uninitialized
Remove unused variables and ambiguous dangling else