thermal-hal: Add exception handling for stoi

stoi can throw exception when an invalid value is passed in buffer.
Enable exception handling and add retry mechanism when a exception is
thrown.

Change-Id: I2c1e0ddbbb408cb6b9739b516296125ec1efd64a
4 files changed