I'm am very much in favor of open source always but let's not pretend that embedded systems don't end up with out of date software just because it's open source.
In the case of WannaCrypt0r, the vulnerability had already been fixed by Microsoft but those who were hit hadn't patched because as discussed elsewhere applying patches may break things so some postpone or ignore it. Same thing could have happened to a system running Linux.