Gold firms after three days of losses as equities drop