A 16-year-old boy who allegedly made an online threat to carry out a mass shooting at a NSW mosque has been charged.