Deep search for hydrogen peroxide toward pre- and protostellar objects. Testing the pathway of grain surface water formation