Oil holds under $40 with demand uncertainty keeping lid on gains