For windows ensure dll stays alive until remoteaccess threads close

* See http://blogs.msdn.com/b/oldnewthing/archive/2013/11/05/10463645.aspx