Massachusetts teen sentenced to prison for texting while driving