Gold edges lower; decline in stock markets limits losses