Solves #5407: Implement and test writable view for the diagonal .function

Implements task raised in issue #5407. 
The ``ndarray.diagonal`` method currently returns a view, but it is not writeable. It is documented to return a writeable view in 1.10.
Correspondingly, the ``writable`` flag is set to ``True`` and the assert statement and the test function are changed accordingly.