Red Sox beat Orioles 8-7, stay tied for wild card