Section 23. If an employee files any claim or accepts payment of compensation on account of personal injury under this chapter, or submits to a proceeding before the department under sections ten to twelve, inclusive, such action shall constitute a release to the insurer of all claims or demands at common law, if any, arising from the injury. If an employee accepts payment of compensation under this chapter on account of personal injury or makes an agreement under section forty-eight, such action shall constitute a release to the insured of all claims or demands at common law, if any, arising from the injury.