Check for and report an error on key buffer overrun.

This usually wasn't a problem as the key buffer is generally large
enough to hold a single value. Still on short buffers or very long
it could have silently overrun before.
Return more than a single dirent at a time in bfs_read_dir().

Return as many dirents as fit into the provided buffer. The readdir()
implementation in libroot tries to get many dirents and caches them to
reduce the amount of syscalls and the associated overhead.

This reduces the syscall count dramatically for use cases where a lot
of directories are enumerated. A "git status" on a Haiku repository for
example goes from over 50k read dir syscalls down to just under 7k.
The performance gain is only around a moderate 5% in that use case
though.