Backport various gst uninstalled bug fixes into 1.16
Specifically, these: !49 (merged), !50 (merged), !52 (merged) (one commit), !58 (merged), !63 (merged), !66 (merged), !76 (merged), !86 (merged), !88 (merged), !90 (merged)
!49 (merged) is a new feature, but it is a very simple feature that happens to change a function prototype and cause all the other commits to conflict, so I included it too.
This MR is needed to cleanly backport newer MRs into 1.16: !103 (merged), !104 (merged), !105 (merged), !106 (merged)
Edited by Nirbheek Chauhan