Maine gunman accused of killing 4, wounding 3 has violent criminal history, released from prison days earlier