Add support for attaching a managed array to a stream.
Update signature for ManagedAllocation.attach() and add documentation.