The RegKey::encode_transacted allows for encoding a serializable value using an existing transaction
To make this work, a few changes were made to Encoder and Transaction
Transaction now implements AsRef which shouldn't change anything
Encoder now stores a generic AsRef instead of a fully owned Transaction
This allows for two implementations, one is the existing one that owns the transaction and commits it on drop, the other only has a borrowed transaction that will not cause a commit on drop
This way an existing transaction can be used
Also added an example for transacted_serialization