Make sure exceptions are registered before opening the library

Signed-off-by: John Else <john.else@citrix.com>