Fix memory leaks

Fix memory leaks in AssemblySolver, and using SimTK::XML. Addresses issues #173, #171. Issue #170 is left open as a place holder for known memory leaks even though testInitState now passes on windows.