Fix for machines and their power problems

Fixes machines being powered after construction
Fixes vending machines and autolathe being unaccesible for maintenance
when depowered
Fix #5321
Partially fix #5832