Merge branch 'master'; commit '2.0.14'
plugins/Plugin.pm: fix bad state file handling (fixed)

This commit is a redo of bogus bf7a258081d64bb6174f83482d5d6dd53cb5909a
and it includes the fix from sweetpea in ticket 1342.

Closes: #1342
Merge branch 'fix-state' into stable-2.0