A 16-year-old boy is in a critical condition after trying to take his own life at Western Australia's controversial youth detention unit at an adult prison.