Create a copy of the state.
struct nm_iam_state* nm_iam_dump_state(struct nm_iam* iam)
iam:
a deep copy of the input IAM state (or NULL if allocation fails)