President Obama has been thwarted in his attempts to close the military-run prison at the Guantanamo Bay U.S. Naval Base in Cuba.