get_shared_lib_extension(): strip debug extension from so ext

closes #3057

needs testing on macos and windows, I have no idea what DEBUG_EXT returns there