Linear extension operators for restrictions of function spaces to irregular open sets