s3-winreg: Fix _winreg_QueryValue crash bugs and implement windows behavior.