A West Australian teenager has been arrested after he allegedly threatened a mass shooting on a Sydney mosque in an online post.