How to stop drush displaying a Drupal error message?
Two options:


Hide the messages with ob_start() and ob_end().
Avoid the messages by moving the target file out of the way, and moving it back again after saving the entity.