Fix ar handling

This PR fixes handling of input files on the command line to 'emcc' depending of their file suffixes. Removes cases of silent failures, and makes the CMake toolchain produce proper static library archive files with the AR tool. See the individual commits for detailed comments.

Tested only with the other.test_cmake and the repro instructions provided in #1648 on Windows. Currently running all tests on the 'try' bots in http://clb.demon.fi:8112/waterfall to check that removing the silent fail cases will not break anything existing.