fs: uv_fs_{open,read}_dir for unix

Tested on Linux, MacOS X and SmartOS.

Fixes #1430
Right, this code was already present in earlier versions, I just refactored it a little so that we can compute the maximum directory entry length from a file descriptor or a path.

@bnoordhuis From the repo's history, it seems that [this commit](https://github.com/joyent/libuv/commit/74999f8f9974970e4d71a0df521e178e3149f3df) introduced this code. Do you remember the rationale behind these tests and the default value?