A mechanism for pressure anisotropy and mirror instability in the dayside magnetosheath