[MRG] ENH: Allow connectivity to be a callable in AgglomerativeClutering et.al

Fixes https://github.com/scikit-learn/scikit-learn/issues/3851 (It was marked easy, but I went ahead and fixed it)

The current AgglomerativeClustering conditions connectivity on the input data, which is prevents the reuse of the model for different data (if connectivity is provided initially) and definitely not in a pipeline where the input data is modified (as pointed by @jnothman ).

This fixes it by allowing it to be an int or a callable. If an int, then the kneighbors_graph is used.
There was a test that failed (https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/cluster/tests/test_hierarchical.py#L178) if I checked X to be sparse. So I safely assumed that it works for non-sparse cases as well.