Adds SafeHandle impl and debug.h