Simplify control flow in agent_socket.get_full_msg()