Selena Gomez moves past her pain on the resiliently upbeat ‘Rare’