How do the primary and secondary pistons function in sealing ports and closing passageways between the reservoir and hydraulic circuits?