A prisoner doesn’t stuff cannabis up his anus if it’s ‘totally legal’, appeals court says