Stable commutator length in Baumslag–Solitar groups and quasimorphisms for tree actions