Add method to finalize the dynamic storage allocator (#418)

* [core] implement alloc::finalize for the dynamic storage allocator

* [core] adjust tests for the changes

* [core] apply rustfmt

* [core] fix clippy warning

* [core] add SAFETY comments to dynamic storage allocator for Wasm

* [core] add a Note to the docs of alloc::{initialize, finalize}
16 jobs for master in 6 minutes and 2 seconds (queued for 3 seconds)
Name Stage Failure
failed
examples-generate-metadata Examples
No job log
failed
examples-clippy-std Examples
No job log
failed
clippy-wasm Workspace
No job log
failed
fmt Workspace
No job log