Defer mutex unlock.
Added SimilarEuclidean and Similar for use with any function conforming to comparison.