Unifying Demonstration Selection and Compression for In-Context Learning