Fix case where PHP's symlink returns false without any error or warning.
Merge pull request #1781 from qcho/symlinkfix

Fix case where PHP's symlink returns false without any error or warning.
Fail if the CLI SAPI is not used to invoke composer
Fix tests