sort by heat safety so mechanisms of the least appropriate heat safety
are used first, saving the magma-safe mechanisms for when they are
needed
filter out unreachable mechanisms
item_id -1 => item_id or -1
that is, we wanted to default to -1, not subtract 1 from the item_id
- `buildingplan`: fix choosing the wrong mechanism (or something that isn't a mechanism) when linking a lever and manually choosing a mechanism, but then canceling the selection
## Misc Improvements
- `buildingplan`: save magma safe mechanisms for when magma safety is requested when linking levers and pressure plates to targets
- `buildingplan`: when choosing mechanisms for linking levers/pressure plates, filter out unreachable mechanisms
- `tailor`: corrected a corner case that resulted in existing stock being ignored in some circumstances