Fixed JDK6 detection in windows

Lines 33-42 check `JAVA_HOME` since `winreg` appears to be spotty on a few platforms (currently on windows 7 x64).

Line 50 explicitly adds `HKLM` as the hive to search (which is where Java installation entries are stored).

Line 99 adds double quotes around the command (which won't break on *nix systems either within POSIX bash interpreters either) which fixes issues on windows when the path contains spaces.

Lines 100-102 perform a simple error check. It was used to debug line 99, but since no other error checking is being performed on something that has a high chance of failing I left it in there.