I have seen that signal info before.
I've done some more digging, and I can of course avoid the problem by just looping and using the LOCK_NB flag. I've implemented and tested that with success. The file I was locking was also on NFS, and when I tried it with a local file the problem does not exist either. This is good enough for my purposes, since I'm be using it on a local file in actual usage. My development is just done on an NFS share.