Russia has released former US Marine Robert Gilman after more than four years in prison over a disputed assault charge.