Add detection of unused struct fields

This uncovered some dead code, most notably in middle/liveness.rs, which I think suggests there must be something fishy with that part of the code.

The #[allow(dead_code)] annotations on some of the fields I am not super happy about but as I understand, marker type may disappear at some point.
This is an odd enough use case that I think that it's ok to use `#[allow(dead_code)]`. You should add a comment as well explaining why this "dead code" is allowed. The reason is that linux doesn't need this lock, but all other platforms do.