Yeah the powering on when getting plugged in is normal.
It is designed to do that so the battery charge level can read more accurate with their way the phone is programmed.
With the unlock I would also recommend to contact Microsoft.
If not a T-Mobile sold phone they probably don't have the code.