clearly differentiate suffixes from endings (dot + suffix) in emcc
differentiate suffixes from endings in filename_type_ending as well
properly check for libx.so.1.2.3 types when deciding what to link in statically, and improve testing for that; fixes #1886