Define det and logdet for AbstractMatrix. 

Fix some unrelated ambiguity warnings triggered by that change. This should fix #7543