Merge two arrays preserving the order of the shared items.