Police Scotland is taking court action over the way the Scottish Government is handling calls to extend the terms of reference of the inquiry into the death of a man in police custody.