MAINT: create ensure_symmetric utility function to check matrix symmetry

(first commit of this is from PR #4021)

This PR creates a utility function called ``ensure_symmetric`` which checks whether a matrix is symmetric. This also fixes a (possible?) bug in the validation check for ``spectral_embedding``: it compares the absolute difference of the matrix with its transpose.
PEP 257 requires a 1 line summary first:

```python
def check_symmetric(array, tol=1E-10, raise_warning=True,
                  raise_exception=False):
    """Make sure that array is 2D, square and symmetric.

    Check that the array is symmetric two-dimensional array or sparse matrix,
    returning a symmetrized version and optionally raising a warning or
    exception if the input is not symmetric.
    ...
    """
    ...
```