The museum will retain a 17th-century Dutch painting by Adriaen van Ostade, after striking a deal with two Jewish art dealers.