Fix issues that GroupBy and Sample doesn't call 'unsubscribe' and also NPE when the key is null in GroupBy

Fix #1958
@akarnokd could you take a look at my latest commit? Is it exactly what you mean?