Coverity #1199717, fix a bug in 7179a227 where the test for a lock was
accidentally included inside a test for compacting.
Update dist/s_style to check for cases where we jump to the error label
after passing it, that's an infinite loop.