Fix win32 function invocation and catch exceptions

This commit adds extra checks for dictionary keys and catches
KeyErrors. Additionally it fixes a bug with incorrect invocation
of LsaAddAccountRights. It also checks for the presence of a slash
in the Windows user name - if not present, prepends the domain name.