SafeHandle Dispose and SetHandleAsInvalid behaves differently from Ms.Net

IDisposable design pattern specify that the implementation of Dispose() and Dispose(bool) should allow for the method to be called more than once.

I wasn't sure if Close should also allow for multiple calls. So Close still have the old behaviour of throwing ObjectDisposedException.

This change is released under the MIT license.
This can be bool type as well