Update pre-push hook so that only maint-* and release-* can get pushed to origin.

See #29531 (moved) for motivation

Edit: correct ticket