kc: move 'find ccache for principal' into a function