This trial will evaluate Hu5F9-G4, a monoclonal antibody which is designed to block a protein called CD47, which is widely expressed on human cancer cells. Blocking CD47 with Hu5F9-G4 may enable the body's immune system to find and destroy the cancer cells. In this study, Hu5F9-G4 may be given alone or in combination with azacitidine to patients with acute myeloid leukemia (AML) or higher risk myelodysplastic syndrome (MDS). Azacitidine is a drug used for treatment of AML or MDS in patients who are not eligible for typical chemotherapy.