Edinburgh university principal Sir Peter Mathieson has taken a potentially lucrative second job despite warning staff of looming layoffs.