Chatbot given power to close 'distressing' chats to protect its 'welfare'