reg.exe: Fix stack overflow on large registry keys

This will slice off the end of the output (And probably newlines)
but it's better than a stack overflow
reg.exe: Add path_get_key() to remove boilerplate
reg.exe: Add wchar/type conversion functions
reg.exe: Add wchar/raw data conversion functions
reg.exe: Implement query functionality