Obama invokes Gandhi, Mandela in support for second term