Fixing leaks in USBMux packet handling and AMDeviceRef lifecycle

Added comments to document USBMux packet lifecycle.
Fixed AMDeviceRef finalize function so it doesn't segfault.
Fixed instances where AMDeviceRefs were created and never released.