Added SafeInvoke helper class to Threading demo