Add a context manager for opening hive files

Add a context manager in windows.py for reading and writing hive
files. Whenever a method needs to access the Windows registry it should
use this context manager.
Implement a foreach_user method on windows

This method passes the Relative ID (RID) registry node of each user to a
callback function. Use this method to collect the active users of the
image.