Fix bug introduced by r351184. We should check the returned handle, not the pointer to it.
Noticed by: ian X-MFC with: r351184 MFC after: 1 week