Include unistd.h as it is the standard location for getopt().

OK millert@
missing unsigned char casts areound tolower()
ok nicm
Handle empty current directory more gracefully.
With -k, kill window after using it to work out -c path. Reported by
jmacristovao at gmail dot com.
Replace ## by # in format.
Add comments to ACS table matching terminfo(5).
+.
+.
Note libevent version.
+.
Use 0 if O_DIRECTORY is missing, reported by Dagobert Michelsen.
NetBSD broke strnvis when they added it, check for that.
Remove unnecessary calls to va_start/va_end, from Tiago Cunha.
Simplify args_set, from Tiago Cunha.
Style and comment fixes from Tiago Cunha.
Three small changes from Tiago Cunha:

- Check for truncation when copying path.
- Don't need to use a temporary buffer in screen_set_title.
- Include strerror in output when connecting to server fails.
Allow attach-session -t to accept a window and pane to select them on
attach. Based on a diff from J Raynor.
Similar to attach-session, make switch-client -t accept a window and
pane. From Johannes Jakobsson.
Fix a memory/fd leak reported by Tiago Cunha.
Couple of fixes from cppcheck via Tiago Cunha.