component/bt: Fix bug rfcomm test command cause crash (backport 3.1) See merge request idf/esp-idf!3169