Allow pickling of Resources.