plink: Patch to fix build, add test

Closes #958.