An owner who has been served with a notice of intention to file or a notice of the filing of a claim by a subcontractor may retain out of any moneys due or to become due to the contractor named therein, a sum sufficient to protect the owner from loss until such time as the claim is finally settled, released, defeated or discharged.
49 P.S. § 1601