Spurs overcome shaky finish to beat Magic, 114-113