Terminal device and method for data transmission control in the terminal device