Fix for #656

BasicAppHost.Dispose() throws a NullReferenceException if called without Init() having been called. This pull request contains the fix and a test to verify it.