Move DEBUG_PROTOCOL section for received messages

Move the debug protocol output to the function where we can produce the entire
received message instead of just the payload.