common: include dirent.h to solve implicit declaration errors

Closes #1190