avoiding exceptions when context was lost while creating filter or drawing to RenderTexture (closes #642, closes #643)