Fix constness of diagonal() and transpose() for MSVC.