Improve handling of --install-dir option
Improve handling of --install-dir option

This fixes an edge-case bug where `is_dir` returns true but `realpath`
fails (on Cygwin), resulting in the current directory being used.

johnstevenson/getcomposer.org,composer/getcomposer.org,johnstevenson/getcomposer.org,composer/getcomposer.org,composer/getcomposer.org,johnstevenson/getcomposer.org