Sets APP_DIR correctly when installing on Cygwin

Changes the order of env_var lookup to select the *NIX version when both are available.