BC547 Getting heated, why
Well, you have 10.2 volts between collector and emitter and 20 mA flowing. That's a power of over 200 mW and it will get quite warm. If you don't have any circulating air (natural or forced) the transistor will just get warmer and warmer until is dies. There is also to consider that you might be operating this device in a naturally warm environment and this just adds to the woes.

Thermal resistance of the device is specified by Fairchild as being 200 degC/ watt so it will certainly rise at least 40 degC just on the power dissipation alone and, like I said, if there is no circulating air (or other cooling mechanism), it will continue to get hotter.