lndir: queue: use stdlib.h

Use stdlib.h instead of duplicating some prototypes and macros.
lndir: fix typing

Fix typing to avoid compilation warnings on 64-bit environments.