seekdir_basic: fix various Coverity issues
Address..
- .. resource leaks of file descriptors and memory
- .. unchecked return values from creat(2), mkdir(2), and telldir(3)
- .. potential NULL derefs after calling readdir(3)
MFC after: 1 week
Reported by: Coverity
CID: 975255, 975256, 976989, 978989, 978990