prevent test process from hang in some cases

This commit fixes hang of MS Test process of VS 2013 and makes Dispose patter to ensure that server is dead(useful for single test or if registered in injection container)