On Pattern-Avoiding Partitions