Gov. Martin O’Malley’s proposal to shift part of the expense of teacher pensions to Maryland counties prompted lawmakers on Friday to question whether the added cost should be factored into a state law that requires counties to maintain a certain amount of spending on schools.