librbd: add crypto flattening to flattening operation
This commit enables correct flattening of images where encryption is loaded.
In particular, this means:
1. Flattening the encryption header (which is non addressable when encryption is loaded)
2. Running format-specific flattening operation (i.e. reverting the LUKS magic in the encryption header)
The allow the above 2 operations, we shut-down the crypto layers, and restore them back when these operations end.
The above operations are performed as part of a format-specific handler (LUKSEncryptionFormat::flatten).