Direct adaptive stabilization of linear systems using query-based protocols