Fixes #5146 Handle missing stdin when running under celery with rabbitmq or redis