Fix pkg-ssh.

Passed fd is a descriptor of opened directory. Therefore, we skip all
further checks and just use openat/fstatat. This might be insecure if
capsicum is not enabled.
Fix some issues with pkg-ssh parsing.
Revert "Fix pkg-ssh."

This reverts commit 855159cdd43d50543cf0c6365ea8ea5f825aad45.
Restore the fix partially.