Ahmad Rahimi, who once wanted to be a police officer, has been jailed for life for setting off bombs in two US states that injured 30 people.