Reapply "SERVER-7455 Common internal cluster auth function"

This reverts commit cd3101ca2f8e539a4ad425fa8e6da55a935dd2b1, but fixes a symbol
misplacement that broke linking.